From 3b62e60756adc7027cef01607e9649c1fe40a31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Mon, 12 Nov 2012 18:58:22 -0800 Subject: [PATCH] snmp__if_multi: fix properly ifAlias usage. --- plugins/snmp/snmp__if_combined | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/snmp/snmp__if_combined b/plugins/snmp/snmp__if_combined index 26731e17..f573b35e 100755 --- a/plugins/snmp/snmp__if_combined +++ b/plugins/snmp/snmp__if_combined @@ -87,11 +87,12 @@ Should support indexing by - ifIndex - ifName - ifDescr + - ifAlias - mac-address (and anything else MRTG can index by) in addition to OID-index as now. -Pulling in a user definable set of ifName/ifDescr for textual +Pulling in a user definable set of ifName/ifDescr/ifAlias for textual description and even graph_title would also be nice. IFF we get a patch to support the .oldname attribute then we may use @@ -468,6 +469,7 @@ sub do_collect { { 6 => 'ifHCInOctets', 10 => 'ifHCOutOctets', 15 => 'ifHighSpeed', + 18 => 'ifAlias', }); } @@ -601,7 +603,7 @@ END print "\n"; foreach my $if (sort {$a <=> $b} keys %{$snmpinfo}) { - my $alias = $snmpinfo->{$if}->{ifDescr} || "Interface $if"; + my $alias = $snmpinfoX->{$if}->{ifAlias} || $snmpinfo->{$if}->{ifDescr} || "Interface $if"; if (! ($alias =~ /\d+/) ) { # If there are no numbers in the $alias add the if index @@ -620,7 +622,7 @@ END sub do_config_if { my ($host,$version,$if) = @_; - my $alias = $snmpinfo->{$if}->{ifDescr} || "Interface $if"; + my $alias = $snmpinfoX->{$if}->{ifAlias} || $snmpinfo->{$if}->{ifDescr} || "Interface $if"; if (! ($alias =~ /\d+/) ) { # If there are no numbers in the $alias add the if index