Changeset 79
- Timestamp:
- Mar 29, 2011, 5:37:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r78 r79 22 22 # apt-get install snmp fping libnet-cidr-lite-perl libnet-netmask-perl libnet-snmp-perl libnetaddr-ip-perl libyaml-perl 23 23 # libcrypt-des-perl libcrypt-hcesha-perl libdigest-hmac-perl 24 # arping fping bind9-host arpwatch24 # arping net-tools fping bind9-host arpwatch 25 25 26 26 my $KLASK_VAR = '/var/cache/klask'; … … 445 445 446 446 #print "DEBUG $arp $swport -- $sw->{hostname} \n"; 447 if ( $sw->{hostname} eq 'sw10-batE1-3s.hmg.priv' and $swport == 19 ) { $swport = 20; print "DEBUG $swport -- $sw->{hostname} \n";}448 if ( $sw->{hostname} eq 'sw8-batE1-3s.hmg.priv' and $swport == 23 ) { $swport = 24; print "DEBUG $swport -- $sw->{hostname} \n";}447 # if ( $sw->{hostname} eq 'sw10-batE1-3s.hmg.priv' and $swport == 19 ) { $swport = 20; print "DEBUG $swport -- $sw->{hostname} \n";} 448 # if ( $sw->{hostname} eq 'sw8-batE1-3s.hmg.priv' and $swport == 23 ) { $swport = 24; print "DEBUG $swport -- $sw->{hostname} \n";} 449 449 # if ( $sw->{hostname} eq 'sw10-batE1-3s.hmg.priv' ) { print "DEBUG $swport -- $sw->{hostname} \n";} 450 450 # if ( $sw->{hostname} eq 'sw8-batE1-3s.hmg.priv' ) { print "DEBUG $swport -- $sw->{hostname} \n";} … … 1420 1420 1421 1421 sub cmd_updatesw { 1422 my @options = @_; 1423 1424 my $verbose; 1425 1426 my $ret = GetOptionsFromArray(\@options, 1427 'verbose|v' => \$verbose, 1428 ); 1422 1429 1423 1430 init_switch_names('yes'); #nomme les switchs … … 1434 1441 next DETECT_ALL_ROUTER if $resol_arp{mac_address} eq 'unknow'; 1435 1442 $where{$resol_arp{ipv4_address}} = find_all_switch_port($resol_arp{mac_address}); # retrouve les emplacements des routeurs 1443 print "VERBOSE_1: Router detected $resol_arp{ipv4_address} - $resol_arp{mac_address}\n" if $verbose; 1436 1444 } 1437 1445 … … 1449 1457 1450 1458 $db_switch_output_port{$switch->{hostname}} = $switch->{port}; 1459 print "VERBOSE_2: output port $switch->{hostname} : $switch->{port}\n" if $verbose; 1451 1460 } 1452 1461 } … … 1491 1500 for my $switch_detected ( keys %{$where{$ip}} ) { 1492 1501 1493 next DETECTED_SWITCH if not exists $SWITCH_PORT_COUNT{ $db_switch_ip_hostname{$ip} };1502 next DETECTED_SWITCH if not exists $SWITCH_PORT_COUNT{ $db_switch_ip_hostname{$ip} }; 1494 1503 1495 1504 my $switch = $where{$ip}->{$switch_detected}; … … 1502 1511 $db_switch_link_with{ $db_switch_ip_hostname{$ip} } ||= {}; 1503 1512 $db_switch_link_with{ $db_switch_ip_hostname{$ip} }->{ $switch->{hostname} } = $switch->{port}; 1513 print "VERBOSE_3: $db_switch_ip_hostname{$ip} -> $switch->{hostname} : $switch->{port}\n" if $verbose; 1504 1514 #print "DEBUG : $db_switch_ip_hostname{$ip} / $switch->{hostname} : $switch->{port}\n" if $switch->{hostname} !~ m/sw3-batA0-3s/; 1505 1515 }
Note: See TracChangeset
for help on using the changeset viewer.