Changeset 82
- Timestamp:
- Mar 30, 2011, 9:15:33 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r81 r82 280 280 my $verbose = shift; 281 281 282 printf "%-2 5s %-25s %s\n",'Switch','Description','Type';283 print "------------------------------------------------------------------------- \n" if $verbose;282 printf "%-26s %-25s %s\n",'Switch','Description','Type'; 283 print "------------------------------------------------------------------------------\n" if $verbose; 284 284 285 285 INIT_EACH_SWITCH: … … 316 316 # Ligne à virer car on récupère maintenant le modèle du switch 317 317 my ($desc, $type) = split m/ : /xms, $sw->{description}, 2; 318 printf "%-2 5s 0--------->>>> %-25s %s\n", $sw->{hostname}, $desc, $sw->{model} if $verbose;318 printf "%-26s 0--------->>>> %-25s %s\n", $sw->{hostname}, $desc, $sw->{model} if $verbose; 319 319 } 320 320 … … 957 957 my $computerdb = YAML::Syck::LoadFile("$KLASK_DB_FILE"); 958 958 959 printf "%-2 6s %-4s %-40s %-15s %-18s %-16s %s\n", qw(Switch Port Hostname-FQ IPv4-Address MAC-Address Date VLAN);959 printf "%-27s %-4s %-40s %-15s %-18s %-16s %s\n", qw(Switch Port Hostname-FQ IPv4-Address MAC-Address Date VLAN); 960 960 print "--------------------------------------------------------------------------------------------------------------------------------------------\n"; 961 961 … … 976 976 my $date = sprintf '%04i-%02i-%02i %02i:%02i', $year, $mon, $mday, $hour, $min; 977 977 978 printf "%-2 7s %2s <------- %-40s %-15s %-18s %-16s %s\n",978 printf "%-28s %2s <------- %-40s %-15s %-18s %-16s %s\n", 979 979 $computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}, 980 980 $computerdb->{$ip}{switch_port}, … … 1476 1476 next ALL_SWITCH if $resol_arp{mac_address} eq 'unknow'; 1477 1477 1478 push @list_switch_ipv4, $resol_arp{ipv4_address};1478 push @list_switch_ipv4, $resol_arp{ipv4_address}; 1479 1479 1480 1480 $where{$resol_arp{ipv4_address}} = find_all_switch_port($resol_arp{mac_address}); # find port on all switch 1481 1481 1482 1482 if ($verbose) { 1483 my @l = (); 1484 for my $c ( keys %{$where{$resol_arp{ipv4_address}}} ) { 1485 push @l, "$c -+ "; #$where{$resol_arp{ipv4_address}}->{$c}{hostname}; 1486 } 1487 print "VERBOSE_3 $one_computer $resol_arp{ipv4_address} $resol_arp{mac_address} --- @l\n"; 1483 # my @l = (); 1484 # for my $c ( keys %{$where{$resol_arp{ipv4_address}}} ) { 1485 # push @l, "$c -+ "; #$where{$resol_arp{ipv4_address}}->{$c}{hostname}; 1486 # } 1487 print "VERBOSE_3 $one_computer $resol_arp{ipv4_address} $resol_arp{mac_address}\n"; 1488 print "VERBOSE_3 $one_computer --- ", 1489 join(' + ', keys %{$where{$resol_arp{ipv4_address}}}), 1490 "\n"; 1488 1491 } 1489 1492 … … 1582 1585 for my $sw (sort keys %db_switch_output_port) { 1583 1586 if (exists $db_switch_parent{$sw}) { 1584 printf "%-2 7s %2s +--> %2s %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};1587 printf "%-28s %2s +--> %2s %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch}; 1585 1588 } 1586 1589 else { 1587 printf "%-2 7s %2s +--> router\n", $sw, $db_switch_output_port{$sw};1590 printf "%-28s %2s +--> router\n", $sw, $db_switch_output_port{$sw}; 1588 1591 } 1589 1592 } … … 1596 1599 for my $sw (keys %{$db_switch_connected_on_port{$swport}}) { 1597 1600 if (exists $db_switch_output_port{$sw}) { 1598 printf "%-2 7s %2s <--+ %2s %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;1601 printf "%-28s %2s <--+ %2s %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw; 1599 1602 } 1600 1603 else { 1601 printf "%-2 7s %2s <--+ %-25s\n", $sw_connect, $port_connect, $sw;1604 printf "%-28s %2s <--+ %-25s\n", $sw_connect, $port_connect, $sw; 1602 1605 } 1603 1606 } … … 1650 1653 for my $sw (sort keys %db_switch_output_port) { 1651 1654 if (exists $db_switch_parent{$sw}) { 1652 printf "%-2 7s %2s +--> %2s %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch};1655 printf "%-28s %2s +--> %2s %-25s\n", $sw, $db_switch_output_port{$sw}, $db_switch_parent{$sw}->{port}, $db_switch_parent{$sw}->{switch}; 1653 1656 } 1654 1657 else { 1655 printf "%-2 7s %2s +--> router\n", $sw, $db_switch_output_port{$sw};1658 printf "%-28s %2s +--> router\n", $sw, $db_switch_output_port{$sw}; 1656 1659 } 1657 1660 } … … 1664 1667 for my $sw (keys %{$db_switch_connected_on_port{$swport}}) { 1665 1668 if (exists $db_switch_output_port{$sw}) { 1666 printf "%-2 7s %2s <--+ %2s %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw;1669 printf "%-28s %2s <--+ %2s %-25s\n", $sw_connect, $port_connect, $db_switch_output_port{$sw}, $sw; 1667 1670 } 1668 1671 else { 1669 printf "%-2 7s %2s <--+ %-25s\n", $sw_connect, $port_connect, $sw;1672 printf "%-28s %2s <--+ %-25s\n", $sw_connect, $port_connect, $sw; 1670 1673 } 1671 1674 }
Note: See TracChangeset
for help on using the changeset viewer.