Slime: Using Snmpwalk to capture device OID information

Source: Internet
Author: User
Tags snmp snmpwalk cisco switch

This article by show according to Lin Feng to provide friendship sponsorship, starting in the mud row world.

Planning to start learning about monitoring, but now a lot of monitoring systems are based on SNMP. and SNMP monitoring performance indicators are through the Snmpwalk acquisition device OID Information obtained, so today to introduce, how to collect the OID information of the device through Snmpwalk.

To use Snmpwalk to capture the OID information of a device, the following steps are required:

1, understand the principle of snmpwalk

2, Installation Snmpwalk

3. Snmpwalk parameter description

4. How to use Snmpwalk

5. Using Snmpwalk to collect device OID information

6. Equipment OID Information precautions in production environment

First, understand the principle of snmpwalk

Snmpwalk is a tool for SNMP that uses SNMP's getnext request query to specify all OID tree information for the entry of the OID (object identifier in the SNMP protocol) and display it to the user. Snmpwalk can also be used to view additional information about devices that support the SNMP Protocol (network management), such as Cisco switch or router IP addresses, memory usage, and so on, to assist with the development of SNMP capabilities.

Second, installation Snmpwalk

To use Snmpwalk, we will first install Snmpwalk. Snmpwalk does not have a separate installation package, it is included in the NET-SNMP package, so we only need to install the NET-SNMP software package to get snmpwalk. The installation of NET-SNMP is divided into Linux environment and Windows environment, we will introduce each.

2.1 Linux under Install Net-snmp

Using the Snmpwalk tool under Linux, we have to install net-snmp-utils this package.

Note: If Linux installs only Net-snmp, then the Snmpwalk tool is not included, as follows:

Yum-y Install Net-snmp-utils

Snmpwalk-h

2.2 Windows Install under Net-snmp

Under Windows install NET-SNMP, we can go to NET-SNMP official website to download.

Now we are installing the Net-snmp-5.6.1.1-1.x86.exe package. As follows:

The above is a method, there is another way is to use directly, has been produced a good free installation package.

The creation of the no-install package is simple, which is to install the NET-SNMP software package locally and then copy the bin directory from the installation directory to the other server. As follows:

This allows the bin directory to be copied to other machines for use. Note that in the process of using the Snmpwalk tool for more convenient use, we can add the path of the directory to the system environment variables, as follows:

So we'll have the NET-SNMP installed. About the Snmpwalk free installation package can be downloaded at this address "slime snmpwalk5.6.1.1 free installation package".

Three, snmpwalk parameter description

The use of snmpwalk, we can see through the Help information, as follows:

Snmpwalk-h

Through, we can see that the parameters of snmpwalk more, but we are more commonly used only the-V and-C parameters. As follows:

–h: Displays Help.

–V: Specifies the version of SNMP, 1 or 2c or 3.

–c: Specifies the connection device SNMP password.

–V: Displays the current Snmpwalk command line version.

–r: Specifies the number of retries, which defaults to 0 times.

–t: Specifies the wait time-out for each request, in seconds, and 3 seconds by default.

–l: Specifies the security level: Noauthnopriv|authnopriv|authpriv.

–a: Authentication protocol: md5| SHA. Required only IF-L is specified as Authnopriv or Authpriv.

–A: Validates the string. Required only IF-L is specified as Authnopriv or Authpriv.

–x: Encryption protocol: DES. Only required IF-L is specified as Authpriv.

–X: Encrypts the string. Only required IF-L is specified as Authpriv.

Four, the use method and example of Snmpwalk

Snmpwalk is simple to use, as follows:

Snmpwalk-v 1 or 2c (for SNMP version)-C SNMP Password IP address OID (object identifier)

–V: Specifies the version of SNMP, 1 or 2, which must have.

–c: Specifies the connection device SNMP read password, which must have.

IP: Specifies the IP address of the device to be walk, which must have.

OID: This parameter is not required to represent the indicator OID to get the device.

V. Using Snmpwalk to obtain device OID information

Let's start with Snmpwalk to get some OID information about the device, and note that the Windows system is now available, not the Linux system.

Note: We also use the MIB ireasoning MIB browser to explore the software to match our experiments.

5.1 gets the number of Windows system processes

Snmpwalk-v 1-c public 192.168.1.200.1.3.6.1.2.1.25.1.6

This command means: Use the V1 version, the community is public, to the 192.168.1.200.1.3.6.1.2.1.25.1.6 Branch for Walk.

5.2 get the number of Windows system users

Snmpwalk-v 1-c public 192.168.1.200.1.3.6.1.2.1.25.1.5

We can also obtain the following commands:

Snmpwalk-v 1-c Public 192.168.1.200 hrsystemnumusers

Note: The hrsystemnumusers is equivalent to. 1.3.6.1.2.1.25.1.5.

5.1 and 5.2 We can actually get through a command, as follows:

Snmpwalk-v 1-c public 192.168.1.200.1.3.6.1.2.1.25.1

The information obtained includes the running time of the system, the number of users of the system, the number of processes in the system, and the current time of the system.

5.3 get total Windows system memory

Snmpwalk-v 1-c public 192.168.1.200.1.3.6.1.2.1.25.2.2

5.4 get the IP address of the Windows system

Snmpwalk-v 1-c public 192.168.1.200.1.3.6.1.2.1.4.20.1.1

5.5 Get Windows System Information

Snmpwalk-v 1-c Public 192.168.1.200 System

5.6 Get network card information for Windows systems

Snmpwalk-v 1 192.168.1.200-c Public IFDESCR

Six, Device OID Information considerations in production environments

6.1 get the goal and save description

For the development of equipment MIB information to debug, generally require the device's full MIB (including the public OID and private OID), so when the MIB acquisition of the device, use. 1 as the Target MIB branch (that is, the full MIB file). and generally need to use the output > redirect, output to a specified file for easy transmission.

6.2 parameter Option Description

It is generally necessary to use-CC to specify that an OID is not allowed to repeat.

If the device is more likely to time out, you need to use the-T and-r parameters to specify the time-out and retry times.

6.3 MIB Completeness of information

Full walk to a MIB, at the end of the MIB, will output the word "End of MiB". Otherwise, it may be response timeout and other errors, at this time, according to the error message timely adjust parameters.

In general, the Snmpwalk-v 1/2c-c community IP. 1>ip.mib command collects the device MIB information, the file Ip.mib should contain all MIB information for the device.

However, from the actual reaction situation, some equipment manufacturers due to SNMP implementation support is not very standard, so there is only the public MIB information (that is, 1.3.6.1.2.1 beginning of information), then use the command snmpwalk-v 1/2c-c community IP. 1.3.6.1.4.1>ip.private.mib collects the private MIB information of the equipment, and sends the research and development together with the IP.MIB collected previously.

Summary: The integrity of the so-called MIB information, That is, determine whether the file information in the output of the Snmpwalk command contains the OID information (public MIB information) at the beginning of the iso.3.6.1.2.1, and whether it contains the OID information (private MIB information) at the beginning of the iso.3.6.1.4.1, and may even contain the OID information at the beginning of the iso.3.6.1.6.1 ( This part of the information is optional, currently not used).

Slime: Using Snmpwalk to capture device OID information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.