Beginners Guide to Installing, Using, and Configuring Net-SNMP - Part 1 (2024)

Simple Network Management Protocol (SNMP) is a protocol which is widely used for monitoring network-attached devices, including routers, switches, servers, and more, for conditions that require administrative attention.

Net-SNMP is a set of tools and libraries for using and deploying the SNMP protocol. In this article, we will discuss how to download, install, and start using the Net-SNMP suite.

Note – it is expected that readers have at least a basic knowledge of SNMP (including OIDs and MIBs) as well as how it works.

Download and Installation

You can download the latest version of the package from its Sourceforge page. For example, I downloaded version 5.7.3 of the package from the project hosting website using the following command:

wget http://sourceforge.net/projects/net-snmp/files/net-snmp/5.7.3/net-snmp-5.7.3.tar.gz

Please note that the Net-SNMP package depends upon the Perl development package, which you can easily install using the following command:

sudo apt-get install libperl-dev

Once done, decompress the downloaded package using the following command:

tar -xvzf net-snmp-5.7.3.tar.gz

Then enter into the main directory and configure the package :

This will throw up a series of questions that’ll help the Net-SNMP suite determine how the SNMP-related applications are to function. For example, it will ask you which SNMP version (1, 2c, or 3) to use as default:

Beginners Guide to Installing, Using, and Configuring Net-SNMP - Part 1 (1)

Whom to contact:

Beginners Guide to Installing, Using, and Configuring Net-SNMP - Part 1 (2)

Location of the system:

Beginners Guide to Installing, Using, and Configuring Net-SNMP - Part 1 (3)

And location to store the logfile and persistent information.

Beginners Guide to Installing, Using, and Configuring Net-SNMP - Part 1 (4)

You can either enter the requested values or keep pressing the Enter key for the configuration script to pick up the default values. Once done, the configuration script will continue with its work, and if everything goes well, you should get something similar to the following:

--------------------------------------------------------- Net-SNMP configuration summary:--------------------------------------------------------- SNMP Versions Supported: 1 2c 3 Building for: linux Net-SNMP Version: 5.7.3 Network transport support: Callback Unix Alias TCP UDP IPv4Base SocketBase TCPBase UDPIPv4Base UDPBase SNMPv3 Security Modules: usm Agent MIB code: default_modules => snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx disman/event disman/schedule utilities host MYSQL Trap Logging: unavailable Embedded Perl support: enabled SNMP Perl modules: building -- embeddable SNMP Python modules: disabled Crypto support from: internal Authentication support: MD5 SHA1 Encryption support: DES AES Local DNSSEC validation: disabled ---------------------------------------------------------

This means that the configuration part is successful. Next up, compile and install the package using the following two commands:

sudo makesudo make install

Now, execute the following command to download and install the Management Information Base (MIB) files on your system:

sudo apt-get install snmp-mibs-downloader

Next, download and install SNMP agent – a daemon process that performs network management functions as ordered by the manager, which itself is a central system used for monitoring traffic seen by the various SNMP agents. This can be done using the following command:

sudo apt-get install snmpd

Now start the daemon process using the following command:

/etc/init.d/snmpd start

This should start the network management service on your system.

Basic Usage

To check if the package has been properly set up, use the snmpget command to check the system uptime:

snmpget -v 2c -c public 127.0.0.1 SNMPv2-MIB::sysUpTime.0

If you aren’t aware, snmpget is an application that uses the SNMP GET request to query for information on a network entity. On my Ubuntu box, the command produced the following output:

DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (26770) 0:04:27.70

In the output shown above, the last part is the system uptime, indicating that the system had been up for approximately 4 minutes 27 seconds. A point worth mentioning here is that this time is calculated from the time the snmpd daemon was started.

Similarly, you can run the following snmpwalk command to display values corresponding to system-specific variables present under the “.iso.org.dod.internet.mgmt.mib-2.system” MIB tree.

$ snmpwalk -v2c -c public localhost systemSNMPv2-MIB::sysDescr.0 = STRING: Linux himanshu-desktop 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014 i686SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (47647) 0:07:56.47SNMPv2-MIB::sysContact.0 = STRING: Me <me>SNMPv2-MIB::sysName.0 = STRING: himanshu-desktop.........</me>

For those who aren’t aware, the snmpwalk command is designed to retrieve multiple OIDs and values from the remote agent.

Conclusion

As you would have observed, this article was aimed to give you an idea about how to download and install the Net-SNMP package properly. In the second part, we will cover all the basics related to Net-SNMP configuration.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Beginners Guide to Installing, Using, and Configuring Net-SNMP - Part 1 (5)

Himanshu Arora

Himanshu Arora is a freelance technical writer by profession but a software programmer and Linux researcher at heart. He covers software tutorials, reviews, tips/tricks, and more. Some of his articles have been featured on IBM developerworks, ComputerWorld, and in Linux Journal.

  • Facebook
  • Tweet
Beginners Guide to Installing, Using, and Configuring Net-SNMP - Part 1 (2024)

References

Top Articles
Latest Posts
Article information

Author: Tyson Zemlak

Last Updated:

Views: 6335

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Tyson Zemlak

Birthday: 1992-03-17

Address: Apt. 662 96191 Quigley Dam, Kubview, MA 42013

Phone: +441678032891

Job: Community-Services Orchestrator

Hobby: Coffee roasting, Calligraphy, Metalworking, Fashion, Vehicle restoration, Shopping, Photography

Introduction: My name is Tyson Zemlak, I am a excited, light, sparkling, super, open, fair, magnificent person who loves writing and wants to share my knowledge and understanding with you.