Net-SNMP (snmpget, snmpwalk)

If you've ever queried a device over SNMP from a terminal, you've almost certainly used Net-SNMP. It's the open-source suite that ships the commands everyone knows — snmpget, snmpwalk, snmpbulkwalk, snmptable, snmptranslate — and it's the reference implementation the rest of the ecosystem measures itself against. This page is about the toolkit itself: how to install it, how to fire your first snmpget snmpwalk query, the net-snmp commands worth memorizing, what it does well, what it doesn't, and how to poll the same values from outside your network so an alert still reaches you when a box falls over.

What is Net-SNMP (snmpget, snmpwalk)

Net-SNMP is a collection of applications for managing and monitoring devices through SNMP. Two of its command-line tools do most of the heavy lifting. snmpget fetches a single named value — one OID, one answer. snmpwalk starts at a point in the OID tree and walks downward, returning every object underneath it, one GETNEXT at a time, until the subtree runs out. Between them you can pull one precise reading or survey everything a device is willing to tell you.

The suite predates most commercial monitoring software and grew out of the earlier UCD-SNMP project at UC Davis — which is why the Net-SNMP agent's own metrics still live under the enterprise branch 1.3.6.1.4.1.2021, the UCD-SNMP-MIB. It speaks all three protocol versions: SNMPv1 (RFC 1157), SNMPv2c (RFC 3416), and SNMPv3 with its USM authentication and privacy (RFC 3411–3418). On the manager side it's just software you run; on the target side it also provides snmpd, the agent daemon that answers the queries. Most people meet it first as a client.

Terminal screenshot of net-snmp commands snmpget and snmpwalk returning uptime and processor load values

Install & basic use

Getting the client utilities onto a machine is a one-liner on most systems. Here's the path from nothing to your first successful query:

  1. Install the package. Debian or Ubuntu: sudo apt install snmp. RHEL, CentOS, or Fedora: sudo dnf install net-snmp-utils. The agent daemon is a separate package (snmpd) if you also want to answer queries.
  2. Pull in the standard MIBs so replies read as names, not numbers: on Debian, sudo apt install snmp-mibs-downloader and enable them by commenting out the mibs : line in /etc/snmp/snmp.conf.
  3. Verify offline with snmptranslate, which resolves names to OIDs without sending a packet — a quick sanity check that the MIBs loaded.
  4. Run a live query against a device that has an agent answering with an SNMPv2c read community.

That first snmpget snmpwalk pair looks like this:

# Fetch one value — host uptime
snmpget -v2c -c public 10.0.0.5 1.3.6.1.2.1.25.1.1.0
# Walk a whole subtree — the processor table
snmpwalk -v2c -c public 10.0.0.5 1.3.6.1.2.1.25.3.3.1.2

The walk returns one line per logical CPU, each an hrProcessorLoad value from the Host Resources MIB (RFC 2790). If nothing comes back, the device probably isn't publishing that OID — the OID allowlist guide shows how to expose it, and the snmpd.conf guide covers standing up the agent in the first place.

Key commands / features

The suite is more than two commands. This table covers the ones you'll actually type, with the job each one owns and a real example against the OIDs this site documents.

CommandWhat it doesExample
snmpgetFetch one OID's valuesnmpget -v2c -c public 10.0.0.5 1.3.6.1.2.1.25.1.1.0
snmpwalkWalk a subtree via GETNEXTsnmpwalk -v2c -c public 10.0.0.5 1.3.6.1.2.1.2.2.1
snmpbulkwalkWalk faster using GETBULK (v2c+)snmpbulkwalk -v2c -c public 10.0.0.5 1.3.6.1.2.1.31.1.1.1
snmptableRender a conceptual table as a gridsnmptable -v2c -c public 10.0.0.5 hrProcessorTable
snmptranslateConvert OID number ↔ MIB name, offlinesnmptranslate 1.3.6.1.2.1.25.3.3.1.2

A few flags recur everywhere. -v2c picks the version; -c gives the community string; -On forces numeric output when MIBs aren't installed; -Os trims to the short object name. For encrypted polling, the SNMPv3 form is longer but worth it:

snmpget -v3 -l authPriv -u monitor -a SHA -A authpass -x AES -X privpass 10.0.0.5 1.3.6.1.2.1.25.1.1.0

snmpbulkwalk deserves a special mention. On any interface table — say ifTable at 1.3.6.1.2.1.2.2.1 or the 64-bit ifXTable at 1.3.6.1.2.1.31.1.1.1 from the IF-MIB (RFC 2863) — it collapses dozens of round trips into a handful, which matters over slow links or against chatty devices.

Pros & cons

Net-SNMP is the default for good reasons, but it's a toolkit, not a monitoring system. Knowing the edges saves frustration.

  • Pro — everywhere. It's packaged for every Linux distro, the BSDs, and macOS, and it's the implementation most documentation assumes.
  • Pro — scriptable. Plain text in, plain text out. It drops straight into shell scripts, cron jobs, and pipelines.
  • Pro — complete. Get, walk, bulk, table, translate, and trap handling all in one consistent suite.
  • Con — raw. There's no GUI, no autocomplete for OIDs, and error messages assume you already understand the protocol.
  • Con — MIB setup is fiddly. Getting name resolution working trips up nearly everyone the first time.
  • Con — it queries, it doesn't watch. There's no history, no dashboard, no alert. A snmpwalk tells you the value now; keeping an eye on it over time is a different tool's job.

Alternatives

When the bare command line feels too raw, a MIB browser gives you a clickable tree to explore what a device offers before you script anything. For testing scripts against predictable data without real hardware, snmpsim stands up a fake agent. The broader tools pillar maps the whole landscape, the tools comparison puts the options side by side, and the home page frames how SNMP monitoring fits together end to end.

The gap Net-SNMP can't close on its own is continuous, external alerting. A cron job running snmpget on the very server you're worried about goes silent exactly when the server does. That's the case for polling from off-box — the double durability idea of keeping an independent watcher outside the network. ostr.io Monitoring does precisely that with SNMPv2c: it polls your chosen OIDs from outside and fires real-time email and SMS alerts, zero setup on a dashboard you have to babysit.

Diagram showing snmpbulkwalk retrieving an interface table with fewer round trips than snmpwalk

Frequently asked questions

What's the difference between snmpget and snmpwalk?

snmpget retrieves exactly the OIDs you name — one value each, no more. snmpwalk starts at an OID and returns everything beneath it in the tree, walking downward with repeated GETNEXT requests. Use snmpget when you know precisely what you want; use snmpwalk to discover or dump a whole subtree.

When should I use snmpbulkwalk instead of snmpwalk?

Whenever the agent supports SNMPv2c or v3 and you're pulling a large subtree. snmpbulkwalk uses GETBULK to grab many objects per request instead of one, so it's markedly faster on big tables like interface counters. snmpwalk remains the safe choice against v1-only devices.

How do I get names instead of numbers in the output?

Install the standard MIBs (the snmp-mibs-downloader package on Debian) and enable them in /etc/snmp/snmp.conf. Without them, Net-SNMP prints numeric OIDs. You can also force numbers deliberately with the -On flag when you want raw output.

Is Net-SNMP secure?

It's as secure as the version you use. SNMPv2c sends the community string in clear text, so keep it to trusted networks. For authentication and encryption on the wire, use SNMPv3 with the -l authPriv mode shown above.

Conclusion

Net-SNMP is the toolkit that taught most of us how SNMP actually behaves. snmpget for a single value, snmpwalk to survey a subtree, snmpbulkwalk when speed matters, snmptable to see a table laid out, and snmptranslate to move between numbers and names — those net-snmp commands cover the vast majority of day-to-day querying. What the suite won't do is watch a value over time and page you when it drifts. For that, pair it with an external monitor that keeps polling from outside, so the alert still lands even when the server itself has gone dark.

Monitor it from outside the network

SNMP only tells you a box is healthy while something is still asking. ostr.io polls your endpoints externally and fires email + SMS alerts the moment a reading crosses your line — or the agent goes silent.