Changeset 118
- Timestamp:
- Apr 5, 2013, 2:34:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r117 r118 94 94 J9021A => { model => 'HP2810-24G', match => 'ProCurve J9021A Switch 2810-24G' }, 95 95 J9022A => { model => 'HP2810-48G', match => 'ProCurve J9022A Switch 2810-48G' }, 96 J8692A => { model => 'HP3500-24G', match => 'ProCurve J8692A Switch 3500yl-24G' }, 96 97 J4903A => { model => 'HP2824', match => 'J4903A.+?Switch 2824,' }, 97 98 J4110A => { model => 'HP8000M', match => 'HP J4110A ProCurve Switch 8000M' }, 98 99 BS350T => { model => 'BS350T', match => 'BayStack 350T HW' }, 100 N3483G => { model => 'NA3483-6G', match => 'GigaSwitch V3 TP SFP-I 48V ES3' }, 99 101 ); 100 102 … … 109 111 Readonly my $RE_MAC_ADDRESS => qr{ [0-9,A-Z]{2} : [0-9,A-Z]{2} : [0-9,A-Z]{2} : [0-9,A-Z]{2} : [0-9,A-Z]{2} : [0-9,A-Z]{2} }xms; 110 112 Readonly my $RE_IPv4_ADDRESS => qr{ [0-9]{1,3} \. [0-9]{1,3} \. [0-9]{1,3} \. [0-9]{1,3} }xms; 113 114 Readonly my $RE_FLOAT_HOSTNAME => qr{ ^float }xms; 111 115 112 116 … … 507 511 } 508 512 513 if ($sw_model eq 'HP3500-24G') { 514 if ($sw_port > 289) { 515 516 my $reste = $sw_port - 289; 517 return "Trk$reste"; 518 } 519 } 520 509 521 return $sw_port; 510 522 } … … 546 558 547 559 return 48 + $reste; 560 } 561 } 562 563 if ($sw_model eq 'HP3500-24G') { 564 if ($sw_port =~ m/^Trk/xms ) { 565 566 my $reste = substr $sw_port, 3; 567 568 return 289 + $reste; 548 569 } 549 570 } … … 891 912 ) 892 913 and ( 893 not $mactimedb{$ip_mac}->{hostname_fq} =~ m/ ^float/894 or $ip_hostname_fq =~ m/ ^float/914 not $mactimedb{$ip_mac}->{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/ 915 or $ip_hostname_fq =~ m/$RE_FLOAT_HOSTNAME/ 895 916 )) { 896 917 print "remove ip $ip\n" if $verbose; … … 907 928 ) 908 929 and ( 909 not $ip_hostname_fq =~ m/ ^float/910 or $mactimedb{$ip_mac}->{hostname_fq} =~ m/ ^float/930 not $ip_hostname_fq =~ m/$RE_FLOAT_HOSTNAME/ 931 or $mactimedb{$ip_mac}->{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/ 911 932 )) { 912 933 print "remove ip ".$mactimedb{$ip_mac}->{ip}."\n" if $verbose; … … 1231 1252 1232 1253 if ( 1233 ($ip_hostname_fq =~ m/ ^float/ and $ip_timestamp > $swithportdb{$swpt}->{timestamp} + (15 * 24 * 3600))1254 ($ip_hostname_fq =~ m/$RE_FLOAT_HOSTNAME/ and $ip_timestamp > $swithportdb{$swpt}->{timestamp} + (15 * 24 * 3600)) 1234 1255 or 1235 ($ip_hostname_fq !~ m/ ^float/ and (1236 ($swithportdb{$swpt}->{hostname_fq} =~ m/ ^float/ and $ip_timestamp > $swithportdb{$swpt}->{timestamp} - (15 * 24 * 3600))1256 ($ip_hostname_fq !~ m/$RE_FLOAT_HOSTNAME/ and ( 1257 ($swithportdb{$swpt}->{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/ and $ip_timestamp > $swithportdb{$swpt}->{timestamp} - (15 * 24 * 3600)) 1237 1258 or 1238 ($swithportdb{$swpt}->{hostname_fq} !~ m/ ^float/ and $ip_timestamp > $swithportdb{$swpt}->{timestamp})1259 ($swithportdb{$swpt}->{hostname_fq} !~ m/$RE_FLOAT_HOSTNAME/ and $ip_timestamp > $swithportdb{$swpt}->{timestamp}) 1239 1260 )) 1240 1261 ) { … … 1251 1272 foreach my $swpt (keys %swithportdb) { 1252 1273 next if $swpt =~ m/^\s*0$/; 1253 next if $swithportdb{$swpt}->{hostname_fq} !~ m/ ^float/;1274 next if $swithportdb{$swpt}->{hostname_fq} !~ m/$RE_FLOAT_HOSTNAME/; 1254 1275 1255 1276 my $src_ip = $swithportdb{$swpt}->{ip}; … … 1257 1278 foreach my $ip (keys %{$computerdb}) { 1258 1279 next if $computerdb->{$ip}{mac_address} ne $swithportdb{$swpt}->{mac_address}; 1259 next if $computerdb->{$ip}{hostname_fq} =~ m/ ^float/;1280 next if $computerdb->{$ip}{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/; 1260 1281 next if $computerdb->{$ip}{timestamp} < $src_timestamp; 1261 1282
Note: See TracChangeset
for help on using the changeset viewer.