SNMP OID and MIB for interfaces

Below I list the standard OID and MIB with a description for obtaining SNMP different statistics for the network interfaces of switches, routers, access points, network cards in servers, etc.

You can check OID and MIB from Linux for example with a command (where .1, this is an OID):

snmpwalk -v2c -c community 192.168.1.2 .1

You can see the description of network interfaces via OID (in parentheses MIB):

.1.3.6.1.2.1.2.2.1.2 (ifDescr)

List of port interface indexes:

.1.3.6.1.2.1.17.1.4.1.2 (ifIndex)

Status of the port, there is a link or not (1-up, 2-down, 3-testing, 4-unknown, 5-dormant, 6-notPresent, 7-lowerLayerDown):

1.3.6.1.2.1.2.2.1.8 (ifOperStatus)

Port status, enabled or disabled by software (1-up, 2-down, 3-testing):

ifAdminStatus

Time of last port change:

1.3.6.1.2.1.2.2.1.9 (ifLastChange)

Port traffic:

1.3.6.1.2.1.2.2.1.10 (ifInOctets)
1.3.6.1.2.1.2.2.1.16 (ifOutOctets)

For 64-bit traffic counters, MIB is used:

ifHCInOctets
ifHCOutOctets

Number of packets containing errors:

1.3.6.1.2.1.2.2.1.20 (ifOutErrors)
1.3.6.1.2.1.2.2.1.20 (ifInErrors)

The number of dropped packets that are essentially error-free, but were discarded for example to free up the buffer space:

ifInDiscards
ifOutDiscards

Physical adress:

ifPhysAddress

The size of the largest package that can be sent:

ifMtu

Interface Type:

ifType

Unicast packets:

ifIntUcastPkts
ifOutUcastPkts

Broadcast packet counter:

ifInBroadcastPkts
ifOutBroadcastPkts

Port speed:

1.3.6.1.2.1.2.2.1.5 (ifSpeed)

List of VLANs:

.1.3.6.1.2.1.17.7.1.4.3.1.1

Uptime of the device:

1.3.6.1.2.1.1.3 (sysUpTime)

Description of the device:

1.3.6.1.2.1.1.1.0

Leave a Reply