Share this post

Table of Contents

Monitoring Debian 10 with SNMP

|

Picture of Louie Mattia
Louie Mattia

Simple Network Management Protocol SNMP) is something that is used widely for monitoring network devices as well as servers. It is possible to integrate SNMP monitoring onto your Debian 10 operating system. This guide will walk through the process of installing, configuring and setting it up on Nagios XI.

Prerequisites

  • A working instance of Nagios XI
  • A internet connection

Step 1: Install SNMP and SNMPD

Most Debian systems don’t come with any of the SNMP tools installed by default, so we will start by installing the necessary tools. We will be starting by updating our package lists using the following command:

sudo apt update

Now we will want to install the SNMP Daemon (snmpd). This is the set of tools responsible for allowing SNMP enabled tools to grab data from the system. We will also be installing snmp for various command line tools, mainly snmpwalk for testing purposes. We will install this by using the command:

sudo apt install snmpd snmp

Step 2: Configure SNMP

Currently the only SNMP requests that the host will respond to will come from the local host. While this is can be useful for testing configuration, we want this to be accessible to Nagios XI. To do this we need to edit snmpd.conf, we will do this with the command:

sudo nano /etc/snmp/snmpd.conf

We are looking for a few sections in this file, first is the agentAddress. The file comes with a commented out section that allows any IP address to be used, its also possible to change it to the IP address of your Nagios XI instance, however both will work for our purposes. The below image shows it after the change.

snmp agentAddress
agentAddress in snmpd.conf

This makes the system accessible through SNMP, but we can get no information as it is, now we need to edit the views.

snmp views
system views in snmpd.conf

These SNMP view definitions specify which parts of the MIB tree are accessible to users. The first line grants access to standard system-related information (under .1.3.6.1.2.1), while the second allows access to enterprise-specific objects (under .1.3.6.1.4.1), thereby controlling the visibility of SNMP data for monitoring and management purposes. Now we have one last thing to configure is the rocommunity line. This will act as a password for SNMP clients to retrieve data. We will be using the default string ‘public’ for simplicity, but we recommend choosing a more secure word of your choice.

snmp rocommunity
rocommunity in snmpd.conf

Step 3: Restart the service

The next step is to restart the SNMP service so that the changes take effect. To do this, simply run the following command:

sudo service snmpd restart

This will restart the SNMP service, and you shouldn’t receive any output if everything is configured correctly. If you do get output, it likely indicates an error in the snmpd.conf file—most often a typo in one of the lines. Please review the file and check for any mistakes. Once that’s sorted, we’ll want to verify that our configurations are working. To do this, we can use the snmpwalk command locally. Alternatively, if you have access to the Nagios XI Linux host, you can perform the test from there as well. The command to use is:

snmpwalk -v 2c -c <rocommunity> localhost/<ip address>

You should receive a very long output, whether you’re testing locally or through the Nagios XI Linux host. If this happens, it confirms that SNMP is set up correctly. It’s even better if you’re able to get it working through the Nagios XI Linux host, as this will verify that the system is correctly receiving and processing SNMP data for monitoring.

Step 4: Set up on Nagios XI

With everything set up, we can now configure monitoring through Nagios XI using the Linux SNMP Wizard. You’ll need to enter the IP address of your Ubuntu device along with the rocommunity string. The SNMP daemon supports multiple versions of SNMP, so the default settings for both the SNMP version and port should work perfectly.

Screenshot 2025 02 13 141809
Linux SNMP Wizard

After configuring the settings, you can choose the hostname and select any services you want to monitor through SNMP. Once these steps are completed, your host will be set up for monitoring. By clicking on the hostname, you’ll see that it is being actively monitored and collecting data for the selected services.

Screenshot 2025 02 13 142048
Host Status for SNMP Host
Screenshot 2025 02 13 142040
Services of new Host

Conclusion

With these steps, we’ve successfully set up Debian 10 to be monitored using SNMP with Nagios XI. If you encounter any issues, please refer to the Nagios Support Forum for assistance.