Parsons, Scott wrote:
I'm attempting to create a script that will indicate the % utilization of a network interface. I need this to export a one shot output that can be called by nagios.
I've tried the following tools but I was unable to find a way to output just the utilization, and just one time: bmon, iftop, ifstat, bwm, dstat, rrdtool, iptraf.
Get the interface counters for the interface, sleep 5 seconds(or more), get them again, calculate the difference taking into account interface speed and you can determine the % utilization that way.
I use SNMP and use these OIDs:
.1.3.6.1.2.1.2.2.1.10.2 = IF-MIB::ifInOctets.2 .1.3.6.1.2.1.2.2.1.16.2 = IF-MIB::ifOutOctets.2 .1.3.6.1.2.1.2.2.1.10.3 = IF-MIB::ifInOctets.3 .1.3.6.1.2.1.2.2.1.16.3 = IF-MIB::ifOutOctets.3
nate