Changeset 167
- Timestamp:
- Jul 11, 2016, 5:20:46 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r166 r167 425 425 } 426 426 427 my $swport = $result->{$research1};428 my $swport_hr = snmp_get_swithport_hr($session, $swport);427 my $swport_num = $result->{$research1}; 428 my $swport_hr = get_human_readable_port($sw->{model}, snmp_get_swithport_hr($session, $swport_num)); 429 429 430 430 $session->close; … … 437 437 # 21->24 45->48 438 438 SWITCH_PORT_IGNORE: 439 for my $p (@{$sw->{portignore}}) { 440 next SWITCH_PORT_IGNORE if $swport_hr ne get_numerical_port($sw->{model},$p); 441 next LOOP_ON_SWITCH; 439 for my $portignore (@{$sw->{portignore}}) { 440 next LOOP_ON_SWITCH if $swport_hr eq $portignore; 442 441 } 443 442 444 443 $ret{switch_hostname} = $sw->{hostname}; 445 444 $ret{switch_description} = $sw->{description}; 446 $ret{switch_port} = get_human_readable_port($sw->{model}, $swport); # $swport;445 $ret{switch_port} = $swport_num; 447 446 $ret{switch_port_hr} = $swport_hr; # human readable 448 447 … … 480 479 481 480 if (defined $result and $result->{$research1} ne 'noSuchInstance') { 482 my $swport = $result->{$research1};483 my $swport_hr = snmp_get_swithport_hr($session, $swport);481 my $swport_num = $result->{$research1}; 482 my $swport_hr = get_human_readable_port($sw->{model}, snmp_get_swithport_hr($session, $swport_num)); 484 483 485 484 $ret->{$sw->{hostname}} = {}; 486 485 $ret->{$sw->{hostname}}{hostname} = $sw->{hostname}; 487 486 $ret->{$sw->{hostname}}{description} = $sw->{description}; 488 $ret->{$sw->{hostname}}{port} = get_human_readable_port($sw->{model}, $swport);487 $ret->{$sw->{hostname}}{port} = $swport_num; 489 488 $ret->{$sw->{hostname}}{port_hr} = $swport_hr; 490 489 … … 568 567 my $sw_model = shift; 569 568 my $sw_port = shift; 569 570 # Not need anymore 571 # get port name by snmp 572 return $sw_port; 570 573 571 574 if ($sw_model eq 'HP8000M') {
Note: See TracChangeset
for help on using the changeset viewer.