Installing a SNMP tool
Debug and troubleshooting SNMP is notoriously awkward. Use this guide and you'll soon master the tools needed, get a better understanding of how SNMP works and most importantly ensure that a device correctly replies to your queries.
Several applications exists for executing an SNMP query - some with a GUI others as a command-line tool. We recommend the command-line tool SnmpWalk and if you're using Microsoft Windows consider downloading this ready to use package otherwise install a version matching your type of operating system (packages exists for Mac OS X and different flavours of Linux/Unix).
After downloading and installing SnmpWalk open a "command prompt" and navigate to the folder where SnmpWalk is located.
Create a SNMP query
The following is a simple SNMP query using SnmpWalk:
snmpwalk -Os -c [community string] -v [SNMP version] [IP] [OID]
- [community string]: By default most SNMP enabled devices uses "public". You may have changed it through the administration tool used to configure the device.
- [SNMP version]: SNMP protocol version, "1" or "2c". Most devices supports "2c".
- [IP]: IP address of the device.
- [OID]: SNMP OID value(s) that you wish to read (optional, but if omitted expect a very long response).
If community string is "public", SNMP protocol version is "2c", the IP address of the device is "192.168.20.113" and you wish to read the "sysDescr" object (OID: iso.188.8.131.52.1.1.1) - then the command will look like this:
snmpwalk -Os -c public -v 2c 192.168.20.113 iso.184.108.40.206.1.1.1
Response from a SNMP enabled device (in this example from a Hewlett Packard network attached printer):
iso.220.127.116.11.18.104.22.168 = STRING: "HP ETHERNET MULTI-ENVIRONMENT,SN:CNFTB69GN4,FN:PT51A2J,SVCID:20222,PID:HP Color LaserJet CM2320nf MFP"
iso.22.214.171.124.126.96.36.199 = OID: iso.188.8.131.52.184.108.40.206.9.1
iso.220.127.116.11.18.104.22.168 = Timeticks: (526523774) 60 days, 22:33:57.74
iso.22.214.171.124.126.96.36.199 = ""
iso.188.8.131.52.184.108.40.206 = STRING: "NPI10BE5A"
iso.220.127.116.11.18.104.22.168 = STRING: "HP Color LaserJet CM2320nf MFP"
iso.22.214.171.124.126.96.36.199 = INTEGER: 72
iso.188.8.131.52.184.108.40.206 = Timeticks: (0) 0:00:00.00
Response from a device not supporting SNMP:
Timeout: No Response from 172.16.132.133
If you get a result like the one above, please verify that the SNMP community string, protocol version and IP address is correct. If the command has been entered correctly you can assume that the device does not respond to SNMP queries. Please see vendor documentation for further troubleshooting.
OID to read values from
You got a valid reply from a SNMP enabled device, now you need to figure out which values that are of interest. Depending on the documentation available this may prove the most tedious part.
SNMP stores values in a tree like structure similar to how files and folders are organized on your hard drive. Each vendor may implement a private branch with specific information about the hardware or use the more generic structure defined by e.g RFC 1156.
Anything under iso.220.127.116.11.2 should be well documented as is follows an agreed standard, but don't be surprised if your device just doesn't comply and produces odd output. Iso.18.104.22.168.4 is vendor specific and typically requires some sort of documentation from the vendor to interpret.
Alternative you can run the snmpwalk example above, but just omit the OID. This will return every information the device is able to display through SNMP. The returned data may be a very long list of OIDs and values.
Tools that can help you to understand what you're looking at: