Changeset 270 for trunk/klask
- Timestamp:
- Sep 15, 2017, 10:25:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r269 r270 491 491 my %ret; 492 492 $ret{'switch_description'} = 'unknow'; 493 $ret{'switch_port '} = '0';493 $ret{'switch_port_id'} = '0'; 494 494 495 495 return %ret if $mac_address eq 'unknow';; … … 547 547 $ret{'switch_hostname'} = $sw->{'hostname'}; 548 548 $ret{'switch_description'} = $sw->{'description'}; 549 $ret{'switch_port '}= $swport_num;549 $ret{'switch_port_id'} = $swport_num; 550 550 $ret{'switch_port_hr'} = $swport_hr; # human readable 551 551 … … 850 850 for my $ip (keys %{$computerdb}) { 851 851 852 # Rename switch_port -> switch_port_id (2017/09/15) 853 if (not exists $computerdb->{$ip}{'switch_port_id' and exists $computerdb->{$ip}{'switch_port'}}) { 854 $computerdb->{$ip}{'switch_port_id'} = $computerdb->{$ip}{'switch_port'} if defined $computerdb->{$ip}{'switch_port'}; 855 } 856 delete $computerdb->{$ip}{'switch_port'} if exists $computerdb->{$ip}{'switch_port'}; 857 852 858 next LOOP_ON_IP_ADDRESS if exists $computerdb->{$ip}{'switch_port_hr'} and defined $computerdb->{$ip}{'switch_port_hr'}; 853 859 854 $computerdb->{$ip}{'switch_port_hr'} = $computerdb->{$ip}{'switch_port '};860 $computerdb->{$ip}{'switch_port_hr'} = $computerdb->{$ip}{'switch_port_id'}; 855 861 } 856 862 … … 1159 1165 switch_hostname => $where{'switch_hostname'}, 1160 1166 switch_description => $where{'switch_description'}, 1161 switch_port => $where{'switch_port'},1167 switch_port_id => $where{'switch_port_id'}, 1162 1168 switch_port_hr => $where{'switch_port_hr'}, 1163 1169 timestamp => $timestamp, … … 1175 1181 switch_hostname => $where{'switch_hostname'}, 1176 1182 switch_description => $where{'switch_description'}, 1177 switch_port => $where{'switch_port'},1183 switch_port_id => $where{'switch_port_id'}, 1178 1184 switch_port_hr => $where{'switch_port_hr'}, 1179 1185 timestamp => $resol_arp{'timestamp'}, … … 1488 1494 my $switch_hostname = $computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'} || 'unkown'; 1489 1495 chomp $switch_hostname; 1490 my $switch_hostname_sort = sprintf '%s % 3s' ,$switch_hostname, $computerdb->{$ip}{'switch_port_hr'};1496 my $switch_hostname_sort = sprintf '%s %06i' ,$switch_hostname, $computerdb->{$ip}{'switch_port_id'}; # Take switch index 1491 1497 1492 1498 my $ip_sort = sprintf '%03i%03i%03i%03i', split m/ \. /xms, $ip; … … 1731 1737 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'hostname_fq'} eq ($computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'}); # switch on himself ! 1732 1738 next LOOP_ON_IP_ADDRESS if ($computerdb->{$ip}{'switch_hostname'} || $computerdb->{$ip}{'switch_description'}) eq 'unknow'; 1733 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'switch_port '} eq '0';1739 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{'switch_port_id'} eq '0'; 1734 1740 1735 1741 my $ip_timestamp = $computerdb->{$ip}{'timestamp'};
Note: See TracChangeset
for help on using the changeset viewer.