Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More
Very good!
I have made a little change in order to use interface name instead of index number. My changes:
index=`snmpwalk -v2c -c $snmpstring $host IF-MIB::ifName | awk -v PORTNAME=”$interface$” ‘$0 ~ PORTNAME {split($1,array,”.”); print array[2]}’`
# current value trafbyteIn=`snmpget -v2c -c $snmpstring $host 1.3.6.1.2.1.31.1.1.1.6.$index |awk {‘print $4’}` trafbyteOut=`snmpget -v2c -c $snmpstring $host 1.3.6.1.2.1.31.1.1.1.10.$index |awk {‘print $4’}`