- Timestamp:
- Oct 31, 2017, 1:29:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r323 r324 2600 2600 my %result_ip = @_; 2601 2601 2602 printf "%-15s %-40s %-16s %s\n", qw(IPv4-Address Hostname-FQ Date VLAN); 2603 print "-------------------------------------------------------------------------------\n"; 2602 my $tb_computer = Text::Table->new( 2603 {align => 'left', align_title => 'left', title => 'IPv4-Address'}, 2604 {align => 'left', align_title => 'left', title => 'Hostname-FQ'}, 2605 {align => 'left', align_title => 'left', title => 'VLAN'}, 2606 {align => 'left', align_title => 'left', title => 'Date'}, 2607 ); 2608 2609 #printf "%-15s %-40s %-16s %s\n", qw(IPv4-Address Hostname-FQ Date VLAN); 2610 #print "-------------------------------------------------------------------------------\n"; 2604 2611 LOOP_ON_IP_ADDRESS: 2605 2612 for my $ip (Net::Netmask::sort_by_ip_address(keys %result_ip)) { 2606 my $vlan_nameid = $result_ip{$ip}->{'vlan'}.'('.get_current_vlan_id($result_ip{$ip}->{'vlan'}).')'; 2607 printf "%-15s %-40s %-16s %s\n", $ip, $result_ip{$ip}->{'hostname_fq'}, $result_ip{$ip}->{'date_last_detection'}, $vlan_nameid; 2608 } 2613 my $vlan_nameid = $result_ip{$ip}->{'vlan'}.'('.get_current_vlan_id($result_ip{$ip}->{'vlan'}).')'; 2614 #printf "%-15s %-40s %-16s %s\n", $ip, $result_ip{$ip}->{'hostname_fq'}, $result_ip{$ip}->{'date_last_detection'}, $vlan_nameid; 2615 $tb_computer->add( 2616 $ip, 2617 $result_ip{$ip}->{'hostname_fq'}, 2618 $vlan_nameid, 2619 $result_ip{$ip}->{'date_last_detection'}, 2620 ; 2621 } 2622 print $tb_computer->title(); 2623 print $tb_computer->rule('-'); 2624 print $tb_computer->body(); 2609 2625 } 2610 2626 … … 2618 2634 <thead> 2619 2635 <tr> 2620 <th scope="col" class="klask-header-left">IPv4-Address </th>2621 <th scope="col" class="sorttable_alpha">Hostname-FQ </th>2622 <th scope="col" class="sorttable_alpha">VLAN </th>2623 <th scope="col" class="klask-header-right">Date </th>2636 <th scope="col" class="klask-header-left">IPv4-Address ⇅</th> 2637 <th scope="col" class="sorttable_alpha">Hostname-FQ ⇅</th> 2638 <th scope="col" class="sorttable_alpha">VLAN ⇅</th> 2639 <th scope="col" class="klask-header-right">Date ⇅</th> 2624 2640 </tr> 2625 2641 </thead> … … 2645 2661 my ( $host_short ) = split m/ \. /xms, $result_ip{$ip}->{'hostname_fq'}; 2646 2662 2647 my $vlan_nameid = $result_ip{$ip}->{'vlan'}.'('.get_current_vlan_id($result_ip{$ip}->{'vlan'}).')'; 2663 my $vlan_nameid = $result_ip{$ip}->{'vlan'}.' ('.get_current_vlan_id($result_ip{$ip}->{'vlan'}).')'; 2664 2665 fqdn_html_breakable(my $hostname_fq_html = $result_ip{$ip}->{'hostname_fq'}); 2648 2666 2649 2667 print <<"END_HTML"; 2650 2668 <tr class="$typerow"> 2651 2669 <td sorttable_customkey="$ip_sort">$ip</td> 2652 <td sorttable_customkey="$host_short">$ result_ip{$ip}->{'hostname_fq'}</td>2670 <td sorttable_customkey="$host_short">$hostname_fq_html</td> 2653 2671 <td>$vlan_nameid</td> 2654 2672 <td>$result_ip{$ip}->{'date_last_detection'}</td>
Note: See TracChangeset
for help on using the changeset viewer.