Commit fb36443f authored by Kirk Webb's avatar Kirk Webb

Added trunk stats lookup (given a member port) to and added snmp-if-deref.sh
to the CVS repo.
parent d32a4f6f
......@@ -15,7 +15,7 @@ include $(OBJDIR)/Makeconf
SUBDIRS = nsgen
BIN_SCRIPTS = delay_config sshtb create_image node_admin link_config \
setdest loghole webcopy linkmon_ctl
setdest loghole webcopy linkmon_ctl snmp-if-deref.sh
SBIN_SCRIPTS = vlandiff vlansync withadminprivs export_tables cvsupd.pl \
eventping grantnodetype import_commitlog dhcpd_wrapper \
opsreboot deletenode node_statewait grabwebcams \
......
#!/bin/sh
SNMPGET="/usr/local/bin/snmpget -m CISCO-STACK-MIB:CISCO-PAGP-MIB -Ovq"
community="public"
if [ $# -lt 4 ]
then
echo "usage: $0 <address> <module> <port> <ifEntry-attribute> [trunk]"
exit 1
fi
addr=$1
module=$2
port=$3
attr=$4
trunk=$5
index=`$SNMPGET $addr $community 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`
fi
retval=`$SNMPGET $addr $community ifEntry.$attr.$index 2> /dev/null`
if [ $? -eq 0 -a "x$retval" != "x" ]
then
echo $retval
exit 0
else
echo "Error getting ifEntry attribute value: $attr" 1>&2
exit 1
fi
else
echo "Error looking up index for module: $module, port: $port" 1>&2
exit 1
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment