LinuxCommandLibrary

snmpwalk

Walk SNMP MIB trees retrieving all values

TLDR

Walk entire MIB

$ snmpwalk -v2c -c [community] [host]
copy
Walk specific OID
$ snmpwalk -v2c -c [public] [host] [1.3.6.1.2.1.1]
copy
SNMPv3 with auth
$ snmpwalk -v3 -u [user] -l authPriv -A [authpass] -X [privpass] [host]
copy
Show numeric OIDs
$ snmpwalk -On -v2c -c [community] [host]
copy
Walk system tree
$ snmpwalk -v2c -c [public] [host] system
copy
Output values only
$ snmpwalk -Oqv -v2c -c [public] [host] [oid]
copy

SYNOPSIS

snmpwalk [-v version] [-c community] [options] host [oid]

DESCRIPTION

snmpwalk retrieves a subtree of management values from an SNMP agent by issuing successive GETNEXT requests. Starting from a specified OID, it walks through the MIB tree and displays all values until it reaches the end of the subtree, providing a comprehensive view of device management data.
The tool supports SNMPv1, v2c, and v3. For v1 and v2c, community strings provide authentication, with "public" being a common read-only default. SNMPv3 adds robust security through username-based authentication (MD5/SHA) and encryption (DES/AES).
The starting OID determines the scope of the walk. Walking from the root retrieves all available data, while specifying a subtree like system or interfaces limits results. Output formatting options like -On (numeric OIDs) and -Oq (quick print) make output easier to parse in scripts.

PARAMETERS

-v VERSION

SNMP version (1, 2c, 3).
-c COMMUNITY
Community string.
-u USER
SNMPv3 username.
-l LEVEL
Security level.
-A PASS
Auth passphrase.
-X PASS
Privacy passphrase.
-On
Numeric OIDs.
-Oq
Quick output.
-Ov
Values only.

CAVEATS

Community strings are plaintext. v3 recommended for security. Large walks may be slow.

HISTORY

snmpwalk is part of Net-SNMP, the standard open-source SNMP implementation. It's essential for network device monitoring and discovery.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community