Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
wc
Community Member

Can I get interface packet rate using SNMP ?

As you know, we can get the 5 min average packet rate of an interface by using the "sh interface" command. Can I get this statistic using SNMP ? If so, what is the MIB and the MIB object ?

5 REPLIES
Blue

Re: Can I get interface packet rate using SNMP ?

You can use the ifInOctets/ifOutOctets (32-bit) and IfHCInOctects/IfHCOutOctets (64-bit) from IF-MIB for this. Also can look at MRTG (www.mrtg.org)

wc
Community Member

Re: Can I get interface packet rate using SNMP ?

I know that MRTG can get the plot of packet rate by reading subsequent values of packet counter at 5min interval and then calculate the average value. However, I want to get the instant 5min packet rate by reading a MIB object (get the result similar to sh interface command). In some DoS cases, it is important for me to get the instant packet rate of each switch port.

Thanks

Community Member

Re: Can I get interface packet rate using SNMP ?

You will get the same value if you look at the MIBs ifInUcastPkts + ifInNUcastPkts and ifOutUcastPkts + ifOutNUcastPkts at a five minute interval. Take reading, subtract previous reading, divide by 300 seconds ((Reading2 - Reading1)/Seconds). You figure you would have to look at the packet rate every five minutes anyway (if it is only a five minute average) so you are not going to be doing much extra work. Also, by reporting the packet counter instead of an average over time, you can get more granular results (just read the value every minute and divide by 60 and you get average over a minute).

wc
Community Member

Re: Can I get interface packet rate using SNMP ?

Our University has more than 20,000 ports. It is not pratical to keep track the byte counts of each port and then calculate the packet rate. We monitor the uplink port of each wirig closet by MRTG only. In case of abnormal traffic like very very high packet rate at the uplink, I want to find out the user port with the highest packet rate by snmp at that time. I prefer to use snmp since it is simple. However, if there is no such MIB available, I will consider to use TELNET moudle of perl to extract the interface statistic directly.

Community Member

Re: Can I get interface packet rate using SNMP ?

Here's a cisco URL which will help you further.

http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a008009496e.shtml

The MIB will differ as per the configuration of your router.

For example :

.1.3.6.1.2.1.2.2.1.16

or

.iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutOctets

Will give you Outgoing octets on a serial interface.

You can fetch this using MRTG 5 min SNMP scan and get this plotted.

In case you still need live stats I would suggest http://www.paessler.com/index_eng.html.

Hope this is of help.

1488
Views
0
Helpful
5
Replies
CreatePlease to create content