Got it

Get Tx / Rx bytes / packets per interface using SNMP

Created: Jan 31, 2022 11:58:58Latest reply: Feb 2, 2022 15:45:53 204 5 0 0 0
  Rewarded HiCoins: 0 (problem resolved)

Dear all,

I have a Router NetEngine 8000 M1 and a switch S5732 and I will need to query the Tx and Rx bytes and  packets per interface using SNMP. To do that I need to know the OIDs of these counters associated to theses parameters. Where I can find this information?. Using a SNMPWalk is hard to find this information.


Thanks in advance


Featured Answers

Recommended answer

chenhui
Admin Created Feb 2, 2022 15:43:13

Posted by alopez1980 at 2022-02-02 14:44 Is it possible that the difference come from that SNMP max value for counter type is 2^32-1 (4294967 ...
Hi,
No, the querying result is predefined, and cannot be modified.
View more
  • x
  • convention:

All Answers
Hello, dear.
It's nice to meet you in the community.
We're working on getting the right answer for you. Please rest assured that we'll be back with an answer shortly.
View more
  • x
  • convention:

I found the OIDs that I should query but there is not match between the information given by SNMP an the information displayed by the CLI command.

SNMP reply:

   <SNMPVariable value='1390937793' (oid='ifOutOctets', oid_index='36', snmp_type='COUNTER')>


display interface GigabitEthernet 0/2/31
GigabitEthernet0/2/31 current state : UP (ifindex: 36)
Line protocol current state : DOWN
Link quality grade : GOOD
Description:
Route Port,The Maximum Transmit Unit(L3) is 1500 bytes, The Maximum Receive Unit(L2) is 9700 bytes
Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4422-7c29-f18c
Media type: twisted-pair ,Link type: auto negotiation
Loopback:none, Maximal BW:1G, Current BW:1G, full-duplex mode, negotiation: enable, Pause Flowcontrol:Receive Enable and Send Disable
Last physical up time   : 2021-12-10 06:29
Last physical down time : 2021-12-10 06:29
Current system time: 2021-12-10 06:29
Statistics last cleared:never
    Last 300 seconds input rate: 152839 bits/sec, 47 packets/sec
    Last 300 seconds output rate: 166236 bits/sec, 30 packets/sec
    Input peak rate 320589211 bits/sec, Record time: 2021-12-10 06:29
    Output peak rate 484722861 bits/sec, Record time: 2021-12-10 06:29
    Input: 17062589467724 bytes, 54900595499 packets
    Output: 28751902016153 bytes, 58262606236 packets
    Input:
      Unicast: 54831946073 packets, Multicast: 3753356 packets
      Broadcast: 64896070 packets, JumboOctets: 5112071385 packets
      CRC: 0 packets, Symbol: 0 packets
      Overrun: 0 packets, InRangeLength: 0 packets
      LongPacket: 0 packets, Jabber: 0 packets, Alignment: 0 packets
      Fragment: 0 packets, Undersized Frame: 0 packets
      RxPause: 0 packets
    Output:
      Unicast: 58260926682 packets, Multicast: 152634 packets
      Broadcast: 1526920 packets, JumboOctets: 12394045251 packets
      Lost: 0 packets, Overflow: 0 packets, Underrun: 0 packets
      System: 0 packets, Overruns: 0 packets
      TxPause: 0 packets
    Last 300 seconds input utility rate:  0.01%
    Last 300 seconds output utility rate: 0.01%


The OID i have used in this example is: 1.3.6.1.2.1.2.2.1.16.36


An the list of OIDs information is:

     . 1.3.6.1.2.1.2.2.1.1 - ifIndex
    • 1.3.6.1.2.1.2.2.1.2.<ifIndex> - ifDescr
    • 1.3.6.1.2.1.2.2.1.3.<ifIndex> - ifType
    • 1.3.6.1.2.1.2.2.1.4.<ifIndex> - ifMtu
    • 1.3.6.1.2.1.2.2.1.5.<ifIndex> - ifSpeed
    • 1.3.6.1.2.1.2.2.1.6.<ifIndex> - ifPhysAddress
    • 1.3.6.1.2.1.2.2.1.7.<ifIndex> - ifAdminStatus
    • 1.3.6.1.2.1.2.2.1.8.<ifIndex> - ifOperStatus
    • 1.3.6.1.2.1.2.2.1.9.<ifIndex> - ifLastChange
    • 1.3.6.1.2.1.2.2.1.10.<ifIndex> - ifInOctets
    • 1.3.6.1.2.1.2.2.1.11.<ifIndex> - ifInUcastPkts
    • 1.3.6.1.2.1.2.2.1.12.<ifIndex> - ifInNUcastPkts
    • 1.3.6.1.2.1.2.2.1.13.<ifIndex> - ifInDiscards
    • 1.3.6.1.2.1.2.2.1.14.<ifIndex> - ifInErrors
    • 1.3.6.1.2.1.2.2.1.15.<ifIndex> - ifInUnknownProtos
    • 1.3.6.1.2.1.2.2.1.16.<ifIndex> - ifOutOctets
    • 1.3.6.1.2.1.2.2.1.17.<ifIndex> - ifOutUcastPkts
    • 1.3.6.1.2.1.2.2.1.18.<ifIndex> - ifOutNUcastPkts
    • 1.3.6.1.2.1.2.2.1.19.<ifIndex> - ifOutDiscards
    • 1.3.6.1.2.1.2.2.1.20.<ifIndex> - ifOutErrors
    • 1.3.6.1.2.1.2.2.1.21.<ifIndex> - ifOutQLen
    • 1.3.6.1.2.1.2.2.1.22.<ifIndex> - ifSpecific


Thanks in advance

View more
  • x
  • convention:

Is it possible that the difference come from that SNMP max value for counter type is 2^32-1 (4294967295 decimal) and when it wraps around and starts increasing again from zero?
View more
  • x
  • convention:

Posted by alopez1980 at 2022-02-02 14:44 Is it possible that the difference come from that SNMP max value for counter type is 2^32-1 (4294967 ...
Hi,
No, the querying result is predefined, and cannot be modified.
View more
  • x
  • convention:

Posted by alopez1980 at 2022-02-01 06:58 I found the OIDs that I should query but there is not match between the information given by SNMP an ...
Hi,
The querying result is in hexadecimal, you can translate that into decimal manually.
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.