diff --git a/utils/snmp-if-deref.sh b/utils/snmp-if-deref.sh index 45c62077b63d8488b59cb6f6ac65b3dff033d742..898fd73be733e8ee4b902792cd39f8affafa5dc9 100755 --- a/utils/snmp-if-deref.sh +++ b/utils/snmp-if-deref.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2006 University of Utah and the Flux Group. +# Copyright (c) 2006-2015 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -22,9 +22,10 @@ # }}} # -SNMPGET="/usr/local/bin/snmpget -m CISCO-STACK-MIB:CISCO-PAGP-MIB -Ovq" community="public" +SNMPGET="/usr/local/bin/snmpget -v 2c -c $community -m CISCO-STACK-MIB:CISCO-PAGP-MIB -Ovq" + if [ $# -lt 4 ] then echo "usage: $0
[trunk]" @@ -38,15 +39,15 @@ attr=$4 trunk=$5 -index=`$SNMPGET $addr $community portIfIndex.$module.$port 2> /dev/null` +index=`$SNMPGET $addr portIfIndex.$module.$port 2> /dev/null` if [ $? -eq 0 -a "x$index" != "x" ] then if [ "x$trunk" = "xtrunk" ] then - index=`$SNMPGET $addr $community pagpGroupIfIndex.$index 2> /dev/null` + index=`$SNMPGET $addr pagpGroupIfIndex.$index 2> /dev/null` fi - retval=`$SNMPGET $addr $community ifEntry.$attr.$index 2> /dev/null` + retval=`$SNMPGET $addr ifEntry.$attr.$index 2> /dev/null` if [ $? -eq 0 -a "x$retval" != "x" ] then echo $retval