Share this post

Table of Contents

How to Configure SNMP on SUSE 12 and Monitor with Nagios XI

|

Picture of Tucker Falen
Tucker Falen

SNMP (Simple Network Management Protocol) is a commonly used protocol for monitoring and managing network devices and servers.. If you want to integrate SNMP monitoring on your SUSE Linux Enterprise Server (SLES) 12, this guide will walk you through the installation, configuration, and testing of SNMP, ensuring your system is ready to send monitoring data to Nagios. This article will be using SNMPv2c!

Step 1: Install SNMP Packages

SNMP is most likely pre-installed on your system, but just in case. To install SNMP on SUSE 12, you need to install the Net-SNMP package, which includes the SNMP daemon (snmpd) and useful command-line tools like snmpwalk and snmpget.

Run the following command to install the necessary packages:

sudo zypper install net-snmp net-snmp-utils

This will install:

  • snmpd: The SNMP daemon that collects system data
  • snmpwalk, snmpget, snmptrap: Utilities for querying SNMP data

Step 2: Configure SNMP Daemon

After installing SNMP, you must configure it to allow access from the monitoring system.

  1. Open the SNMP configuration file:
sudo vi /etc/snmp/snmpd.conf
  1. Look for the rocommunity public line and modify it to allow your monitoring system’s IP. For example, if your Nagios server is at 192.168.1.146, change:
Screenshot 2025 02 12 103406 edited
rocommunity myCommunityString 192.168.1.146

Replace myCommunityString with a strong community string.

Screenshot 2025 02 12 103249

Note: If you want to allow access from any system (not recommended for security), use:

rocommunity myCommunityString default

Once you are done editing your file, save and exit (ESC, then :wq).

Step 3: Enable and Start SNMP Service

After configuring SNMP, enable and start the service so it runs automatically on boot:

sudo systemctl enable snmpd
sudo systemctl start snmpd

Check if SNMP is running:

sudo systecmctl status snmpd
Screenshot 2025 02 12 103640
Example enabling and starting snmpd

Step 4: Open Firewall for SNMP

SNMP uses UDP port 161. If your monitoring server is external, allow this port through the firewall:

sudo /usr/sbin/SuSEfirewall2 open EXT UDP 161
sudo systemctl restart SuSEfirewall2.service

If using firewalld, run:

sudo firewall-cmd --zone=public --add-source=<YOUR-IP-ADDRESS> --permanent
sudo firewall-cmd --zone=public --add-port=161/udp --permanent
sudo firewall-cmd --reload

Step 5: Test SNMP Configuration

Once SNMP is installed and configured, test it using snmpwalk on your Nagios XI server.

Test from Your Monitoring Server (e.g., Nagios)

If running the test from your Nagios server, replace <SUSE_SERVER_IP> with your SUSE server’s IP:

snmpwalk -v 2c -c myCommunityString <SUSE_SERVER_IP>

If you see a lot of HOST-RESOURCES-MIB data, SNMP is working correctly!

Step 6: Monitor with Nagios

From your Nagios XI web interface home page, click on Run a Wizard.

Screenshot 2025 02 11 102801 1
Nagios XI homepage

Then, scroll until you find the Linux SNMP wizard.

Screenshot 2025 02 12 141405
Wizards page

Then enter the IP address of your SUSE 12 machine. Leave the SNMP version at 2c and the SNMP Port at 161. The SNMP Community is where you will enter the community string you created in the conf file in Step 2.

Screenshot 2025 02 12 142445
Linux SNMP configuration wizard page

Now, you can change any settings you need and choose which metrics you would like to monitor.

Screenshot 2025 02 12 142349 1
Configuration page

By default, you will be monitoring some basic services. When you are done configuring your settings and choosing SNMP services to monitor you can hit Next, and then Finish with Defaults.

Congratulations! You have successfully installed and configured SNMP on SUSE 12 and integrated it with Nagios. Your server is now actively monitored for performance metrics like CPU, memory, and uptime.