How to Configure SNMP on SUSE 12 and Monitor with Nagios XI
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-utilsThis 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.
- Open the SNMP configuration file:
sudo vi /etc/snmp/snmpd.conf- Look for the
rocommunity publicline and modify it to allow your monitoring system’s IP. For example, if your Nagios server is at 192.168.1.146, change:

rocommunity myCommunityString 192.168.1.146Replace myCommunityString with a strong community string.

Note: If you want to allow access from any system (not recommended for security), use:
rocommunity myCommunityString defaultOnce 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 snmpdCheck if SNMP is running:
sudo systecmctl status 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.serviceIf 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 --reloadStep 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.

Then, scroll until you find the Linux SNMP wizard.

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.

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

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.




