-
Notifications
You must be signed in to change notification settings - Fork 34
Collecting Data for Troubleshooting with the snmpwalk Utility
You are having trouble collecting SNMP metrics from a device, or you need to see which Object Identifiers (OIDs) your device supports.
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
snmpwalkinstalled. If not, install it withapt-get install snmporyum install net-snmp-utils.
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.0Where $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.0Replace 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.46To 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.outSNMP 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.outThe 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.