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