As we know, asset management is one of the crucial elements in IT service management. To deliver services consistently and ensure a high quality of services, it is important to keep the devices and the IT infrastructure running smoothly.
Failures in critical devices can cause costly service disruptions and therefore it is important to constantly monitor device parameters and maintain them regularly. An SNMPwalk is a simple and easy-to-use tool with which you can manage and monitor the devices in your network. In this article, we explore what it is and how you can use it.
What is the Simple Network Management Protocol (SNMP)?
SNMP or Simple Network Management Protocol is an application-layer Internet Standard protocol used for managing information about devices on an IP network. It can also be used to modify the device information and change device behavior. It has been used since the 1980s and is a common element of asset management solutions as well as network management and monitoring.
Most networking devices such as routers, modems, and switches support the SNMP protocol. They are also supported by devices like printers, cameras, computer hosts, and other IP devices.
The protocol lets devices on the same network communicate with each other and is commonly used for collecting information about the health and status of the devices on the network. Since its introduction, there have been three versions namely SNMPv1, SNMPv2, and SNMPv3. The different versions improved on security, performance, and reliability; the first version was criticized for its poor security and by version 3, cryptographic security was added.
How does the SNMP work?
The Simple Network Management Protocol consists of two device types; manager and managed devices. As you can imagine, the managers are a group of computers that monitors and handles the managed devices. The managed devices all come under a single network and can be any of the devices mentioned before (modems, printers, IP cameras, etc).
The manager devices have the network management station software and the managed devices have a software called an agent or an SNMP agent. The third component is the Management Information Base or the MIB. The MIB is a shared database between the manager and a managed device. The agent collects the information about the device and stores it within the MIB. The MIB has the complete set of information about the specific managed device stored as values of different variables each identified by an Object Identifier or an OID.
Depending on the SNMP version, messages may be sent using UDP or TCP. To get information from an agent, the manager may send requests from any available port which are then received on port 161 on the agent. The agent can also send unsolicited notifications and messages to the manager.
What are the different types of SNMP protocol data units or messages?
There are seven types of messages or protocol data units transmitted between managers and agents:
- GetRequest: GetRequest is sent from a manager to an agent to request the value of a variable. The agent responds with the value requested.
- GetNextRequest: This is a request sent from the manager to the agent to find out the variables available in the MIB and their values. For every GetNextRequest, the agent sends out the next variable in the MIB and its value. The message can be used to get all the data stored in the MIB.
- GetBulkRequest: This is similar to GetNextRequest, and is used to collect data in bulk from the agent. It was introduced in SNMPv2.
- SetRequest: This is a message sent from the manager to the agent send to make changes to the device. The message specifies the variables and their new values and after making the changes the agent will send the new values back to the manager.
- Response: Response is a message from the agent to the manager in response to GetRequest, GetNextRequest, GetBulkRequest, SetRequest, and InformRequest. They all contain values of one or more variables.
- Trap: Trap is a message sent from the agent to the manager without a request. They’re usually notifications about any significant changes in the device, usually when there’s a fault. The trap can also be used to send messages between two managers.
- InformRequest: This is a message usually sent from a manager to an agent to confirm the receipt of a trap message. This was introduced in SNMPv2. While trap let managers send messages to each other, the delivery wasn’t confirmed, so to resolve this, the InformRequest was introduced. Agents can be set to send their trap messages until they receive an InformRequest.
What is SNMPwalk?
An SNMPwalk is an application that repeatedly sends out GetNextRequest to collect information about different OIDs. The application bundles together multiple SNMP commands and lets you collect information from multiple devices without having to type out individual commands for all OIDs. It can help you identify devices in the network that are not working. By performing an SNMP walk, you can find out the entire list of devices in your network that supports SNMP and form a library of MIBs.
Besides troubleshooting, an SNMPwalk can also help you figure out what the devices in your network can report; by getting you a complete list of OIDs and their values, you can set up automated SNMP commands to prevent device failure. Let’s say you can get a temperature and the fan speed in one of your devices through SNMP. You can configure the device to send a trap message if the temperature exceeds a certain point and you can configure the manager to send a SetRequest to increase the fan speed.
An SNMP walk can help you get a complete picture of all the information you can get from the devices and help you with your device logic.
How to install SNMPwalk
Installing SNMPwalk is fairly straightforward.
Download the files from Sourceforge.
Run the executable file snmpwalk.exe
Install the components.
Installing SNMPwalk on Linux is fairly simple, though it varies with the specific version of Linux you’re using.
For Ubuntu, enter the following command: apt-get install snmp
For Redhat/Fedora/CentOS, enter the following command: yum install net-snmp-utils
How to run SNMPwalk
Once installed, you can run an SNMPwalk from your command prompt. Just type "snmpwalk" followed by your parameters and hit enter.
For example, "snmpwalk -v1 -c public localhost" performs an snmpwalk on the localhost
The commands are fairly simple. Just type snmpwalk and set the parameters, followed by the IP address you want to poll. Some of the common parameters are SNMP version (-v), community string (-c), etc. With version three, you can set more parameters like authentication, encryption, etc.
You can access the help menu and view all the parameters using the command: snmpwalk -h
Frequently asked questions
What is SNMP or Simple Network Management Protocol?
SNMP is an internet standard protocol used for devices to communicate with each other. It has been in use since the 1980s for monitoring and managing devices in an IP network. It is usually embedded in IP devices like routers, switches, modems, etc, and is used to send information about their health to managing devices.
What is an SNMPwalk?
An SNMPwalk is an application used to get a complete list of device data available in a network. The application sends a repeated set of SNMP commands to agents in a network who in turn will send back the available device parameters and their values.