Changeset 53
- Timestamp:
- Jul 24, 2009, 1:01:13 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r52 r53 282 282 283 283 # Ligne à virer car on récupère maintenant le modèle du switch 284 my ($desc, $type) = split ':', $sw->{description}, 2;284 my ($desc, $type) = split m/ : /xms, $sw->{description}, 2; 285 285 printf "%-25s 0--------->>>> %-25s %s\n", $sw->{hostname}, $desc, $sw->{model} if $verbose; 286 286 } … … 302 302 "A"=>"10", "B"=>"11", "C"=>"12", "D"=>"13", "E"=>"14", "F"=>"15" 303 303 ); 304 my @chars = split m//x , $car;304 my @chars = split m//xms, $car; 305 305 return $table{$chars[-2]}*16 + $table{$chars[-1]}; 306 306 } … … 312 312 my $arp = shift; 313 313 314 my @paquets = split m/ : /x , $arp;314 my @paquets = split m/ : /xms, $arp; 315 315 my $return = ''; 316 316 foreach(@paquets) { … … 612 612 my %db_switch_chained_port = (); 613 613 for my $swport (keys %db_switch_connected_on_port) { 614 my ($sw_connect,$port_connect) = split ':', $swport;614 my ($sw_connect,$port_connect) = split m/ : /xms, $swport; 615 615 $db_switch_chained_port{$sw_connect} .= "$port_connect:"; 616 616 } … … 619 619 if ( exists $db_switch_chained_port{$sw->{hostname}} ) { 620 620 chop $db_switch_chained_port{$sw->{hostname}}; 621 push @{$sw->{portignore}}, split( ':',$db_switch_chained_port{$sw->{hostname}});621 push @{$sw->{portignore}}, split(m/ : /xms, $db_switch_chained_port{$sw->{hostname}}); 622 622 } 623 623 # print "$sw->{hostname} ++ @{$sw->{portignore}}\n"; … … 903 903 my $switch_hostname_sort = sprintf "%s %3s" ,$switch_hostname, $computerdb->{$ip}{switch_port}; 904 904 905 my $ip_sort = sprintf "%03i%03i%03i%03i", split( m/ \. /x , $ip);905 my $ip_sort = sprintf "%03i%03i%03i%03i", split( m/ \. /xms, $ip); 906 906 907 907 my $mac_sort = sprintf "%04i-%s", 9999 - $mac_count{$computerdb->{$ip}{mac_address}}, $computerdb->{$ip}{mac_address}; 908 908 909 909 $computerdb->{$ip}{hostname_fq} = 'unknow' if $computerdb->{$ip}{hostname_fq} =~ m/^ \d+ \. \d+ \. \d+ \. \d+ $/x; 910 my ( $host_short ) = split m/ \. /x , $computerdb->{$ip}{hostname_fq};910 my ( $host_short ) = split m/ \. /xms, $computerdb->{$ip}{hostname_fq}; 911 911 912 912 print <<"END_HTML"; … … 947 947 my $date = sprintf "%04i-%02i-%02i %02i:%02i", $year,$mon,$mday,$hour,$min; 948 948 949 my $ip_sort = sprintf "%03i%03i%03i%03i", split( m/ \. /x , $ipv4_address);949 my $ip_sort = sprintf "%03i%03i%03i%03i", split( m/ \. /xms, $ipv4_address); 950 950 951 951 my $mac_sort = sprintf "%04i-%s", 9999, $mac_address; 952 952 953 my ( $host_short ) = sprintf "%s %3s" , split(m/ \. /x , $db_switch_parent{$sw}->{switch}, 1), $db_switch_parent{$sw}->{port};953 my ( $host_short ) = sprintf "%s %3s" , split(m/ \. /xms, $db_switch_parent{$sw}->{switch}, 1), $db_switch_parent{$sw}->{port}; 954 954 955 955 print <<"END_HTML"; … … 981 981 982 982 for my $swport (sort keys %db_switch_connected_on_port) { 983 my ($sw_connect,$port_connect) = split ':', $swport;983 my ($sw_connect,$port_connect) = split m/ : /xms, $swport; 984 984 for my $sw (keys %{$db_switch_connected_on_port{$swport}}) { 985 985 … … 995 995 my $date = sprintf "%04i-%02i-%02i %02i:%02i", $year,$mon,$mday,$hour,$min; 996 996 997 my $ip_sort = sprintf "%03i%03i%03i%03i", split( m/ \. /x , $ipv4_address);997 my $ip_sort = sprintf "%03i%03i%03i%03i", split( m/ \. /xms, $ipv4_address); 998 998 999 999 my $mac_sort = sprintf "%04i-%s", 9999, $mac_address; … … 1003 1003 if (exists $db_switch_output_port{$sw}) { 1004 1004 1005 my ( $host_short ) = sprintf "%s %3s" , split( m/\./x 1005 my ( $host_short ) = sprintf "%s %3s" , split( m/\./xms, $sw, 1), $db_switch_output_port{$sw}; 1006 1006 1007 1007 print <<"END_HTML"; … … 1238 1238 $maybe_more_than_one_switch_connected = 'yes'; 1239 1239 1240 my ($sw_connect,$port_connect) = split ':', $swport;1240 my ($sw_connect,$port_connect) = split m/ : /xms, $swport; 1241 1241 my @sw_on_same_port = keys %{$db_switch_connected_on_port{$swport}}; 1242 1242 … … 1289 1289 print "------------------------------------------------\n"; 1290 1290 for my $swport (sort keys %db_switch_connected_on_port) { 1291 my ($sw_connect,$port_connect) = split ':', $swport;1291 my ($sw_connect,$port_connect) = split m/ : /xms, $swport; 1292 1292 for my $sw (keys %{$db_switch_connected_on_port{$swport}}) { 1293 1293 if (exists $db_switch_output_port{$sw}) { … … 1357 1357 print "------------------------------------------------\n"; 1358 1358 for my $swport (sort keys %db_switch_connected_on_port) { 1359 my ($sw_connect,$port_connect) = split ':', $swport;1359 my ($sw_connect,$port_connect) = split m/ : /xms, $swport; 1360 1360 for my $sw (keys %{$db_switch_connected_on_port{$swport}}) { 1361 1361 if (exists $db_switch_output_port{$sw}) { … … 1382 1382 my %db_building= (); 1383 1383 for my $sw (@SWITCH) { 1384 my ($building, $location) = split m/ \/ /x , $sw->{location}, 2;1384 my ($building, $location) = split m/ \/ /xms, $sw->{location}, 2; 1385 1385 $db_building{$building} ||= {}; 1386 1386 $db_building{$building}->{$location} ||= {}; … … 1405 1405 $l++; 1406 1406 1407 print "\"location$b-$l\" [label = \"$building".'/'.join('\n',split( "/",$loc))."\", color = black, fillcolor = orange, style = filled];\n";1407 print "\"location$b-$l\" [label = \"$building".'/'.join('\n',split(m{ / }xms, $loc))."\", color = black, fillcolor = orange, style = filled];\n"; 1408 1408 # print "\"location$b-$l\" [label = \"$building / $loc\", color = black, fillcolor = orange, style = filled];\n"; 1409 1409 print "\"building$b\" -> \"location$b-$l\" [len = 2, color = firebrick]\n"; … … 1421 1421 1422 1422 for my $swport (keys %db_switch_connected_on_port) { 1423 my ($sw_connect,$port_connect) = split ':', $swport;1423 my ($sw_connect,$port_connect) = split m/ : /xms, $swport; 1424 1424 next if not $sw_connect eq $sw; 1425 1425 next if $port_connect eq $db_switch_output_port{$sw}; … … 1446 1446 # print "------------------------------------------------\n"; 1447 1447 for my $swport (sort keys %db_switch_connected_on_port) { 1448 my ($sw_connect,$port_connect) = split ':', $swport;1448 my ($sw_connect,$port_connect) = split m/ : /xms, $swport; 1449 1449 for my $sw (keys %{$db_switch_connected_on_port{$swport}}) { 1450 1450 if (exists $db_switch_output_port{$sw}) {
Note: See TracChangeset
for help on using the changeset viewer.