Comprehensive SNMP Monitoring of AlmaLinux 8 with Nagios XI

Picture of Ayub Huruse
Ayub Huruse
AlmaLinux 8

Ensuring the health and performance of Linux servers is crucial for maintaining a stable and efficient IT environment. Simple Network Management Protocol (SNMP) provides a lightweight, agentless solution for monitoring AlmaLinux 8 with Nagios XI, allowing administrators to track critical system metrics without installing additional software.

This guide will take you through the complete process of setting up SNMP on AlmaLinux 8, integrating it with Nagios XI, and enabling real-time monitoring for proactive issue resolution and improved system reliability.

Prerequisites

Before proceeding, ensure the following:

  • An AlmaLinux 8 system with root or sudo privileges
  • Nagios XI installed and accessible, with the SNMP Wizard enabled
  • A stable internet connection for package downloads

Step 1: Install SNMP on AlmaLinux 8

  1. To install SNMP and the required libraries, run:
sudo dnf install net-snmp net-snmp-utils -y
  1. After installation, verify the installed version:
snmpd -v

Step 2: Configure SNMP Access

SNMP v2c Configuration

  1. Create a backup of the existing configuration:
sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
  1. Edit the SNMP configuration file:
sudo nano /etc/snmp/snmpd.conf
  1. Replace or update the line with your community string and Nagios XI IP:
rocommunity Str0ngC0mmunity 10.25.5.12
  1. Save the file and restart SNMP:
sudo systemctl restart snmpd.service

SNMP v3 Configuration (More Secure)

  1. Stop the SNMP service temporarily:
sudo systemctl stop snmpd.service
  1. Create an SNMP user with authentication and encryption:
sudo net-snmp-create-v3-user -ro -a SHA -A Str0ng@uth3ntic@ti0n -x AES -X Str0ngPriv@cy nagios
  1. Restart the SNMP service:
sudo systemctl restart snmpd.service

Step 3: Configure Firewall Rules

  1. If firewalld is active, allow SNMP traffic on UDP port 161:
sudo firewall-cmd --zone=public --add-port=161/udp --permanent
sudo firewall-cmd --reload
  1. Confirm firewall rules:
sudo firewall-cmd --list-ports

Step 4: Enable SNMP Service on Boot

To ensure SNMP starts automatically at boot:

sudo systemctl enable snmpd.service

Step 5: Test SNMP Communication

From your Nagios XI server:

For SNMP v2c:

snmpwalk -v2c -c Str0ngC0mmunity 10.25.5.12

For SNMP v3:

snmpwalk -v3 -u nagios -l authPriv -a SHA -A Str0ng@uth3ntic@ti0n -x AES -X Str0ngPriv@cy 10.25.5.12

Expected Output (Example):

iso.3.6.1.2.1.1.1.0 = STRING: "Linux almalinux8 ..."

If the command does not return data, review SNMP configuration and firewall settings.

Step 6: Add AlmaLinux 8 Host to Nagios XI Using SNMP Wizard

1. Log in to Nagios XI

2. Navigate to Configure > Run a configuring wizard

Screenshot 2025 03 12 083824 10
configuration wizard

3. Search for and select Linux SNMP wizard

Linux SNMP 8
Linux SNMP

4. Enter the AlmaLinux 8 server’s IP address and SNMP credentials

Linux SNMP step 1 8
AlmaLinux 8 credentials

5. Click Next, select the system metrics to monitor (CPU, memory, disk, etc.)

6. Apply the configuration and verify that Nagios XI is collecting SNMP data

Common Issues & Fixes

SNMP Service is Not Running

Check logs for errors:

sudo journalctl -u snmpd --no-pager | tail -20

Restart SNMP if necessary:

sudo systemctl restart snmpd.service

Host Appears “Down” in Nagios XI

Check firewall rules:

sudo firewall-cmd --list-ports

Ensure SNMP is running:

sudo systemctl status snmpd

Verify Nagios XI configuration

Incorrect SNMP Credentials Error

Confirm the correct community string (SNMP v2c) or authentication details (SNMP v3) Restart the SNMP service after changes

Conclusion

You’ve successfully configured SNMP on AlmaLinux 8 for agentless monitoring with Nagios XI, providing real-time system insights. For advanced setups, explore custom SNMP OIDs or additional Nagios XI plugins.

For support:

Share: