SNMP or the Simple Network Management Protocol first emerged as a solution for managing nodes within a network. Since then SNMP data has been used to measure the performance of devices across countless vendors to help ensure that networks stay up and running. Today SNMP is one of the most popular networking protocols in the world and snmpwalk has become a go-to method for scanning multiple nodes at once.
How
Does SNMP Work?
You can go through my article for this as How snmp work.
But still let me provides you some information here as with an SNMP-enabled devices, an SNMP agent collects information from the device and stores it within a Management Information Base (MIB) where this data is stored so that it can be accessed whenever the SNMP manager polls the SNMP agent.
At that time the SNMP
Manager queries the SNMP agent, data is taken from the MIB and sent to the SNMP
Manager where it can be viewed with a network monitoring tool. There are many
different commands that you can use to query an SNMP agent. The most common
ways are through the use of the GET or the GET-Next command.
The GET command is using to taking the Object Identifier (OID) from
available MIB file.
What is snmpwalk?
SNMPWALK |
snmpwalk is the name given to an SNMP application that runs multiple GETNEXT requests automatically. The SNMP GETNEXT request is used to query a device and take SNMP data from a device. The snmpwalk command is used because it allows the user to chain GETNEXT requests together without having to enter unique commands for each and every OID or node within a sub-tree.
The snmpwalk is issued to the root node of the sub-tree so that information is gathered from every connected node. This provides you with an efficient way to collect information from a range of devices like routers and switches. The information you collect arrives in the form of OIDs. An OID is an object which is part of the MIB within an SNMP-enabled device.
Snmpwalk Parameters and Options in Windows and Linux
Snmpwalk has a range of different parameters that you can use. These include the following:
- hostname – The SNMP agent name.
- community -The type of read community.
- object_id – Specify an object ID to return all SNMP objects below it. If NULL then the root of the SNMP objects is taken as the object_id.
- timeout – Number of microseconds before the first timeout.
- retries – How many times to retry the connection in the event of a timeout.
- -Os – Shows the last symbolic element of an OID.
- -c -Sets a community string.
- -v – Specifies the SNMP version you want to use.
How to Minimize the Information You See With snmpwalk
One of the first things you’ll notice when running snmpwalk is that there are too many results for you to read. You can easily end up with thousands of different results. To get around this vendors help you by providing you with a MIB file. The MIB file is used to specify which OIDs are available on a device. Many vendors provide you with a MIB file for each device you have. Having a MIB file allows you to run a query that is specific to that file, rather than walking through everything.
Snmpwalk Examples
When using snmpwalk on a device you will be provided with a range of values by the SNMP agent. You will be walking through the OID from your starting OID onwards. If you enter the snmpwalk command on a device then a similar result to the following will display:
As you can see that is a lot of information generated by a single command. Most of the lines are comprised of information pulled from the MIB.
In the example below, you can see a snmpwalk example with no MIB. The second number on the first line or the 1.3.6.1.2.1.1.5.0 is the OID that we started from.
Below is a snmpwalk example command on Linux. As you can see this functions in much the same way walking through the OIDs to pull the relevant information from the connected devices:
Comments