Skip to content

Collecting Data for Troubleshooting with the snmpwalk Utility

Marc Netterfield edited this page Apr 30, 2026 · 1 revision

Collecting Data for Troubleshooting with the snmpwalk Utility

Problem

You are having trouble collecting SNMP metrics from a device, or you need to see which Object Identifiers (OIDs) your device supports.

Solution

The snmpwalk utility is useful for troubleshooting SNMP issues. Because ktranslate runs on the host network of the Linux host that Docker runs on, snmpwalk results from the same host give an accurate picture of whether your devices are responding to SNMP requests and what they return.

Tip: Most systems have snmpwalk installed. If not, install it with apt-get install snmp or yum install net-snmp-utils.

Connectivity testing

Test connectivity by retrieving the System Object Identifier (sysOID) from the device. A successful response confirms that SNMP is configured correctly on the device and that network connectivity between the Docker host and the device is working. A failure indicates a problem with your network settings.

Run one of the following depending on your SNMP version:

SNMP v2c:

snmpwalk -v 2c -On -c $COMMUNITY $IP_ADDRESS .1.3.6.1.2.1.1.2.0

Where $COMMUNITY is your SNMP community string and $IP_ADDRESS is the target device IP.

SNMP v3:

snmpwalk -v 3 -l $LEVEL -u $USERNAME -a $AUTH_PROTOCOL -A $AUTH_PASSPHRASE -x $PRIV_PROTOCOL -X $PRIV_PASSPHRASE -ObentU -Cc $IP_ADDRESS .1.3.6.1.2.1.1.2.0

Replace the following settings as necessary:

$LEVEL           == noAuthNoPriv | authNoPriv | authPriv
$USERNAME        == SNMP v3 User
$AUTH_PROTOCOL   == MD5 | SHA
$AUTH_PASSPHRASE == Authentication passphrase
$PRIV_PROTOCOL   == DES | AES
$PRIV_PASSPHRASE == Privacy passphrase
$IP_ADDRESS      == target device IP

Example output:

.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.9.1.46

Capturing a full SNMP walk

To capture output for every OID available on a device, redirect the results to a file. This output is required when opening a profile request on GitHub and is used to create new SNMP profiles for ktranslate.

SNMP v2c:

snmpwalk -v 2c -On -c $COMMUNITY $IP_ADDRESS . >> snmpwalk.out

SNMP v3:

snmpwalk -v 3 -l $LEVEL -u $USERNAME -a $AUTH_PROTOCOL -A $AUTH_PASSPHRASE -x $PRIV_PROTOCOL -X $PRIV_PASSPHRASE -ObentU -Cc $IP_ADDRESS . >> snmpwalk.out

The output file snmpwalk.out will list every OID the device responds to.

Tip: On devices with a large number of interfaces, this SNMP walk can take more than 10 minutes to complete.

Clone this wiki locally