9 min read

SNMP Explained: OIDs, Polling, and Real Data

SNMP is a database you query, not a monitoring system. Learn the OIDs that matter, why 32 bit counters lie, and how to turn a poll into a bandwidth number you can defend.

ByAndré Ribeiro· Founder, Obelinf
SNMP Explained: OIDs, Polling, and Real Data
SNMP Explained: OIDs, Polling, and Real Data · November 3, 2026
On this page

SNMP has a reputation problem, and most of it comes from being used as a monitoring system when it is really a database. The device exposes a tree of objects, each with a numeric address, and a poller asks for those addresses on a schedule. Everything else, the graphs, the thresholds, the alerts, and the dashboards, is built on top of those requests. When the graph is wrong, the problem is usually in the request or in the arithmetic, not in the protocol.

The classic version of that failure is a bandwidth graph that shows a flat line on a busy port. The poller is reading ifInOctets, a 32 bit counter that wraps every 34 seconds at 1 Gbps, and the subtraction goes negative or produces a nonsense spike. The port and the counter are fine; the poll is asking the wrong question. This guide covers the parts that decide whether your data is trustworthy: the OID tree, the interface table, the counter width, the polling interval, and the difference between what a switch reports and what you actually need to know.

At a Glance: SNMP Versions

SNMPv1 SNMPv2c SNMPv3
Authentication Community string Community string User, auth protocol, auth key
Encryption None None Optional, with a privacy protocol
Bulk retrieval No Yes, with GetBulk Yes, with GetBulk
64 bit counters No, Counter32 only Available through the ifXTable Available through the ifXTable
Typical use Legacy devices only Trusted management network Anything crossing an untrusted path
Main risk Clear text and weak Clear text community Misconfigured users and views

An OID Is an Address, a MIB Is the Dictionary

Every object starts at the root and walks down a numbered tree. 1.3.6.1 is the internet branch, 1.3.6.1.2.1 is mib-2, and 1.3.6.1.2.1.1 is the system group. The name is a convenience for humans. The number is what goes on the wire.

The SNMP OID tree from iso down to the system group, the interface table, and the ifXTable counters iso (1) 1.3.6.1 internet 1.3.6.1.2.1 mib-2 system (1) sysName, sysUpTime interfaces (2) ifTable, ifOperStatus ifMIB (31) ifXTable, 64 bit counters ifHCInOctets = 1.3.6.1.2.1.31.1.1.1.6

A scalar object ends in .0 because it has exactly one instance. The device name is 1.3.6.1.2.1.1.5.0, not 1.3.6.1.2.1.1.5. A table object takes the index as the final number, so ifName.101 is the name of the interface whose ifIndex is 101.

snmpget -v2c -c public 192.0.2.10 1.3.6.1.2.1.1.5.0
SNMPv2-MIB::sysName.0 = STRING: sw01

Walking a subtree returns everything under it. This is how you discover what a device supports before you write a poller.

snmpwalk -v2c -c public 192.0.2.10 1.3.6.1.2.1.1
SNMPv2-MIB::sysDescr.0 = STRING: Cisco IOS Software, C9300 Software
SNMPv2-MIB::sysUpTime.0 = Timeticks: (123456789) 14 days, 6:56:07.89
SNMPv2-MIB::sysName.0 = STRING: sw01
SNMPv2-MIB::sysLocation.0 = STRING: DC1 rack 12

If the names do not resolve, the data is still there. Force numeric output with -On, or install the MIB file on the polling server. A missing MIB is a display problem, not a device problem.

The Interface Table Is Where Most Monitoring Lives

The original ifTable is still present, but the useful objects are in ifXTable at 1.3.6.1.2.1.31.1.1.1. The extended table adds the stable interface name, the administrator description, the link speed in Mbps, and the 64 bit counters. Those four additions solve most of the problems people blame on SNMP.

Object OID Unit Use
ifName 1.3.6.1.2.1.31.1.1.1.1 String Stable port name
ifAlias 1.3.6.1.2.1.31.1.1.1.18 String Description or circuit ID
ifAdminStatus 1.3.6.1.2.1.2.2.1.7 Enum Configured state
ifOperStatus 1.3.6.1.2.1.2.2.1.8 Enum Live state
ifHighSpeed 1.3.6.1.2.1.31.1.1.1.15 Mbps Link speed
ifHCInOctets 1.3.6.1.2.1.31.1.1.1.6 Octets Received volume
ifHCOutOctets 1.3.6.1.2.1.31.1.1.1.10 Octets Transmitted volume
ifInErrors 1.3.6.1.2.1.2.2.1.14 Packets Receive errors
ifOutErrors 1.3.6.1.2.1.2.2.1.20 Packets Transmit errors
ifCounterDiscontinuityTime 1.3.6.1.2.1.31.1.1.1.19 TimeTicks Counter reset detection

ifOperStatus uses the values up(1), down(2), testing(3), unknown(4), dormant(5), notPresent(6), and lowerLayerDown(7). A port that is administratively down shows ifAdminStatus down(2) and ifOperStatus down(2). A port with no module can show notPresent(6), which is not the same as a cable failure.

The ifIndex is the join key between all of these objects, and it is not stable on every platform. A reboot, a line card swap, or a module change can renumber it. That is why ifName and ifAlias matter more than the index.

snmpwalk -v2c -c public -On 192.0.2.10 1.3.6.1.2.1.31.1.1.1.1
.1.3.6.1.2.1.31.1.1.1.1.101 = STRING: GigabitEthernet1/0/1
.1.3.6.1.2.1.31.1.1.1.1.102 = STRING: GigabitEthernet1/0/2
.1.3.6.1.2.1.31.1.1.1.1.103 = STRING: TenGigabitEthernet1/1/1

The same index applied to ifAlias gives the human label.

.1.3.6.1.2.1.31.1.1.1.18.101 = STRING: uplink-to-core
.1.3.6.1.2.1.31.1.1.1.18.103 = STRING: wan-nyc-dc1

If the labels are empty, the poller is working and the documentation is not. That is a useful finding, not a reason to add another dashboard.

Counters Wrap, and the Math Is Not Optional

The original ifInOctets and ifOutOctets are 32 bit counters. They count octets, and the maximum value is 4,294,967,295, which is about 4.29 GB. At 1 Gbps, a port can move that much in roughly 34 seconds. At 10 Gbps, in roughly 3.4 seconds.

Counter width Link rate Time to wrap
32 bit 1 Gbps 34.4 seconds
32 bit 10 Gbps 3.4 seconds
32 bit 100 Gbps 0.34 seconds
64 bit 10 Gbps About 467 years
64 bit 100 Gbps About 47 years
Time for 32 bit and 64 bit interface counters to wrap at common link rates Time to wrap at line rate, logarithmic scale 1 s1 min1 h 1 day1 year100 y 1000 y 32 bit at 10G 3.4 s 32 bit at 1G 34 s 64 bit at 100G 47 years 64 bit at 10G 467 years

The rate is the difference between two samples, converted to bits, divided by the elapsed time. A 60 second sample on a link that moved 750,000,000 octets is 100 Mbps.

(750,000,000 octets × 8 bits) / 60 seconds = 100,000,000 bits per second = 100 Mbps

A shell loop makes the same calculation from two polls.

OID=1.3.6.1.2.1.31.1.1.1.6.101
COMMUNITY=public
SWITCH=192.0.2.10

A=$(snmpget -Oqv -v2c -c "$COMMUNITY" "$SWITCH" "$OID")
T1=$(date +%s)
sleep 60
B=$(snmpget -Oqv -v2c -c "$COMMUNITY" "$SWITCH" "$OID")
T2=$(date +%s)

awk -v a="$A" -v b="$B" -v t1="$T1" -v t2="$T2" \
  'BEGIN { if (b < a) { print "counter reset"; exit } printf "%.2f Mbps\n", (b-a)*8/((t2-t1)*1000000) }'

The b < a check matters. A counter reset, a reboot, or a poll that lands during an agent restart produces a lower value, and subtracting it produces a negative rate that some graphing tools render as a spike. Discard the sample and start again.

The polling interval is a design choice, not a default. One minute is a reasonable alerting interval for interface state and utilization. Five minutes is the usual cadence for capacity planning and for the 95th percentile samples that many providers use. The interval must also be shorter than the wrap time at line rate if you are stuck with 32 bit counters, which is another reason to move to the 64 bit objects and stop worrying about it.

What Your Switches Actually Report

SNMP can answer a surprising number of questions, but it answers them at the device and interface level. It is not a flow exporter, and it is not an application monitor.

Question Source Limit
Is the port up? ifOperStatus No view of the peer
Is it saturated? ifHCInOctets Average over the poll
Is it erroring? ifInErrors No cause, only a count
Is the device hot? entSensorValue Sensor placement varies
Which flow is slow? Flow export Not an SNMP object
Why is the app slow? Traces Outside the device

The device level objects are often vendor specific. Cisco exposes CPU in CISCO-PROCESS-MIB at 1.3.6.1.4.1.9.9.109.1.1.1.1.8, the five minute CPU utilization. Juniper exposes its own counters under 1.3.6.1.4.1.2636.3.1.13.1.8.

snmpwalk -v2c -c public 192.0.2.10 1.3.6.1.4.1.9.9.109.1.1.1.1.8
CISCO-PROCESS-MIB::cpmCPUTotal5minRev.7 = Gauge32: 23

Temperature is standardized in ENTITY-SENSOR-MIB, but the value is only meaningful with its type and scale. entSensorValue is 1.3.6.1.2.1.99.1.1.1.4, entSensorScale is 1.3.6.1.2.1.99.1.1.1.2, and entSensorType is 1.3.6.1.2.1.99.1.1.1.1. A type of celsius(8) with a scale of units(9) means the value is already in degrees Celsius.

ENTITY-SENSOR-MIB::entSensorType.1006 = INTEGER: celsius(8)
ENTITY-SENSOR-MIB::entSensorScale.1006 = INTEGER: units(9)
ENTITY-SENSOR-MIB::entSensorValue.1006 = INTEGER: 41

Vendor OIDs are not portable. A Cisco CPU OID does not exist on a Juniper device, and a Juniper temperature OID does not exist on a Cisco switch. Use snmptranslate with the vendor MIB installed, or walk the enterprise subtree and see what answers.

snmptranslate -On -m ALL CISCO-PROCESS-MIB::cpmCPUTotal5minRev

The other limit is architectural. A switch can report that a port is saturated without telling you which host is responsible, and it can report a high CPU without telling you which process caused it. Those questions belong to flow data, streaming telemetry, syslog, and the device’s own command line.

Traps Are Not a Monitoring System

A trap is an unsolicited message from the device. Link state changes, a cold start, and an authentication failure are the classic examples. Traps are useful because they arrive immediately, but they are sent over UDP and they are not retried. A dropped trap is simply lost.

Poll for state, and use traps to shorten the time to notice an event. Do not use traps as the only evidence that a link went down, because the trap that would have told you may be the packet that was dropped during the failure.

snmp-server enable traps snmp authentication linkdown linkup
snmp-server host 192.0.2.50 version 3 priv monitor
snmp-server trap-source Loopback0

trap-source Loopback0 keeps the source address stable across interface changes, which makes the trap easier to attribute on the collector. If the platform supports informs, use them for the events that matter, because an inform is acknowledged and retried.

Secure the Read Path

A community string is a password that travels in clear text in every request. On a management network that is already isolated, that may be an accepted risk. On a network that shares any path with users, it is not.

SNMPv3 separates authentication from privacy. The user authenticates with a key, and the payload can be encrypted with a second key. A read only view keeps the account from changing anything even if the credentials leak.

snmp-server view MONITOR iso included
snmp-server group NOC v3 priv read MONITOR
snmp-server user monitor NOC v3 auth sha AuthPass priv aes 128 PrivPass
snmp-server host 192.0.2.50 version 3 priv monitor

Junos uses the same concepts with a different hierarchy.

set snmp view all oid .1 include
set snmp v3 usm local-engine user monitor authentication-sha authentication-password "AuthPass"
set snmp v3 usm local-engine user monitor privacy-aes128 privacy-password "PrivPass"
set snmp v3 vacm access group readonly default-context-prefix security-model usm security-level privacy read-view all
set snmp v3 vacm security-to-group security-model usm security-name monitor group readonly

The polling command then carries the user and the two keys.

snmpwalk -v3 -l authPriv -u monitor -a SHA -A 'AuthPass' -x AES -X 'PrivPass' \
  192.0.2.10 1.3.6.1.2.1.31.1.1.1.1

SHA-256 and AES-256 are available on recent builds of Net SNMP and on many devices, but support depends on the build and the platform. SHA and AES are the baseline that works almost everywhere. Verify the negotiated level on the device rather than assuming the stronger option was accepted.

Also restrict where the requests can come from. An ACL on the device and a management network that only the pollers can reach are worth more than a longer password.

A Polling Set You Can Defend

The smallest useful set is smaller than most dashboards suggest. Start with the device identity, the interface state, the 64 bit volume counters, the error counters, and the speed. Add vendor objects only after you have confirmed they answer a question you actually ask.

Object Interval Why
sysUpTime 5 min Detect an unexpected reboot
sysName 5 min Keep the identity attached to the data
ifOperStatus 1 min Detect a link change
ifHighSpeed 5 min Know the denominator for utilization
ifHCInOctets 1 min Receive utilization and capacity
ifHCOutOctets 1 min Transmit utilization and capacity
ifInErrors 1 min Physical layer trouble
ifOutErrors 1 min Transmit side trouble
ifAlias 5 min Keep the port label attached to the index

The first run should be an inventory, not a dashboard. Walk ifName, ifAlias, ifOperStatus, and ifHighSpeed on one switch, join them on the index, and compare the result with the port list in your documentation. The ports that are missing a description, or whose description does not match the peer, are the ones that will make the next incident harder than it needs to be.

Obelinf keeps device interfaces and their descriptions in the same inventory as the devices and cables, which makes it easier to reconnect a polled index to the port it represents. The device inventory view is the natural place to start when the labels in the poller and the labels in the documentation disagree.

The first concrete step is to pick one switch and run the interface walk today. If the output has names but no descriptions, you have found a documentation gap that no amount of polling will fix.

Frequently Asked Questions

What is the difference between an OID and a MIB?
An OID is the numeric address of one object in the SNMP tree, such as 1.3.6.1.2.1.31.1.1.1.6. A MIB is the dictionary file that gives that number a name, a type, and a description. The device always answers the numeric OID, so a missing or outdated MIB on your polling server changes the label in the output, not the data on the wire.
What is the difference between SNMPv2c and SNMPv3?
SNMPv2c authenticates with a community string that travels in clear text, so anyone who can capture the packet can read it. SNMPv3 adds user based authentication and optional encryption, which is why it is the only acceptable choice on a network you do not fully trust. SNMPv1 should be treated as legacy and disabled where possible.
Why are my interface counters wrapping or showing impossible values?
The original ifInOctets and ifOutOctets counters are 32 bit, so they wrap after about 4.29 GB. At 1 Gbps that is roughly every 34 seconds, and at 10 Gbps roughly every 3.4 seconds. Poll the 64 bit ifHCInOctets and ifHCOutOctets counters from the ifXTable instead, and discard any sample where the new value is lower than the previous one because the counter reset.
How do I calculate bandwidth from an SNMP counter?
Take the difference between two counter readings in octets, multiply by 8 to get bits, and divide by the number of seconds between the samples. Divide by one million for Mbps. The result is an average over the polling interval, not an instantaneous rate, so a one minute poll smooths out short bursts.
What does ifHighSpeed report?
ifHighSpeed reports the interface bandwidth in units of one million bits per second. It exists because the older ifSpeed object is a 32 bit gauge in bits per second and cannot represent a 10 Gbps link. Use ifHighSpeed for the link speed and ifHCInOctets or ifHCOutOctets for the volume.
Can SNMP tell me why an application is slow?
No. SNMP gives you device and interface state at a point in time, not flow level latency or application response. It can show that a port is saturated or that a device is busy, but it cannot identify which conversation is slow or where the delay is introduced. Pair it with flow data, streaming telemetry, and application traces when the question is about a user experience.
How should I document the interfaces I poll?
Record the device, the ifName, the ifAlias, the ifIndex, the speed, and the peer at the other end. The ifIndex can change after a reboot or a module swap, so the name and the description are the stable handles. Obelinf keeps device interfaces and their descriptions in the inventory, which makes it easier to reconnect a polled index to the port it actually represents.

Stop reaching for a spreadsheet

Obelinf keeps every subnet, device, circuit, and rack in one live source of truth, with audit logs and a topology view. Free for personal use.

Related Articles