4

I want to find per-port bandwidth usage of switch (CISCO 2950) using SNMP. I tried ifInOctets , ifOutOctets , ifSpeed but i dont know it is true or not?

I do snmpget for port 1 and the Result was

Result

ifInOctets = 3404696928
ifOutOctets = 1813440596
ifspeed = 100000000

bandwidth in Mbs is my problem

2 Answers 2

6

The table OID 1.3.6.1.2.1.2.2.1 contains all important network interfaces objects. You found the right objects ifInOctets (1.3.6.1.2.1.2.2.1.10)/ifOutOctets (1.3.6.1.2.1.2.2.1.16) for tracking received/transmitted octets to/from the interface. If you need to get such statistics per port you need to append an index of port to the table OID, e.g. 1.3.6.1.2.1.2.2.1.10.1 for received octets of port 1 and 1.3.6.1.2.1.2.2.1.16.1 for transmitted octets.

With such data, you are already able to calculate input/output utilization per port with simple formulas

(ifInOctets(time1) - ifInOctets(time2)) / (time2 - time1)
(ifOutOctets(time1) - ifOutOctets(time2)) / (time2 - time1)

You get received/transmitted octets per second as a result. You can either write your own script and to incorporate it in your monitoring tool or you can leverage 3rd party tools like Nagios, Cacti, Munin, Mrtg and so on to do such calculations automatically and present them in nice graphs.

2
  • tnx for your response.. so i dont need to ifspeed? and what is the rate unit in this formula? should i divide to 8 then 1024 for convert to Mbs?
    – mohammad
    Sep 3, 2013 at 12:17
  • 1
    There is available this article tinyurl.com/6zlevq on CISCO portal which explains why In/Out objects are usually more reliable then ifSpeed object.
    – dsmsk80
    Sep 3, 2013 at 12:34
0

You can use:

OLD-CISCO-INTERFACES-MIB::locIfInBitsSec."interface number"

will show you the current bit per second usage of a port

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .