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.

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.
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 |
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?
What is the difference between SNMPv2c and SNMPv3?
Why are my interface counters wrapping or showing impossible values?
How do I calculate bandwidth from an SNMP counter?
What does ifHighSpeed report?
Can SNMP tell me why an application is slow?
How should I document the interfaces I poll?
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

SNMP Traps vs Polling vs Streaming Telemetry
Polling, traps, and model driven telemetry describe the same switch but prove different things. Configure all three, then read each one for what it can actually confirm.
Read more
VRRP vs HSRP vs GLBP: First Hop Redundancy
Every host has one default gateway, and that gateway is a single point of failure until you make it virtual. Compare VRRP, HSRP, and GLBP with real configs, timers, and failure checks.
Read more
DAC vs AOC vs Fiber: SFP Compatibility Traps
The port is usually fine. The coding, speed, FEC mode, or fiber grade is not. A practical guide to DAC, AOC, and optical transceivers, with the commands that show what the module actually is.
Read more