From 201c530f642ba9b90059ebc7425f3af67cabeaa4 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 3 Nov 2010 16:37:09 -0400 Subject: Fix to show ifAlias of loopback Need to handle get next of base OID --- scripts/snmp/if-mib-alias | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/snmp/if-mib-alias b/scripts/snmp/if-mib-alias index c713bfe8..82431356 100755 --- a/scripts/snmp/if-mib-alias +++ b/scripts/snmp/if-mib-alias @@ -54,10 +54,17 @@ sub get_oid { print "$oid\nstring\n$ifalias\n" if $ifalias; } +my $BASE = '.1.3.6.1.2.1.31.1.1.1.18'; + sub get_next { my $oid = shift; + + return get_next("$BASE.0") + if ($oid eq $BASE); + die "Not a valid Object ID: $oid" unless ($oid =~ /^([0-9.]*)\.(\d)$/); + my $base = $1; my $ifindex = $2; my @interfaces = get_alias(); -- cgit v1.2.3