Monitoring AlmaLinux 9 with SNMP in Nagios XI: A Step-by-Step Guide

Picture of Ayub Huruse
Ayub Huruse
AlmaLinux 9

Effective Linux server monitoring is essential for ensuring performance and reducing downtime. Simple Network Management Protocol (SNMP) provides an agentless solution to monitor AlmaLinux 9 servers using Nagios XI.

This guide walks you through the process of installing and configuring SNMP on AlmaLinux 9 and integrating it with Nagios XI for centralized, real-time system visibility.

Prerequisites

Before proceeding, make sure you have:

  • AlmaLinux 9 with root or sudo privileges
  • A running Nagios XI server with the SNMP wizard enabled
  • Network connectivity between AlmaLinux and Nagios XI

Step 1: Install SNMP on AlmaLinux 9

  1. Install the SNMP daemon and utilities:
sudo dnf install net-snmp net-snmp-utils -y
  1. Verify SNMP installation:
snmpd -v

Step 2: Configure SNMP Access

SNMP v2c Configuration

  1. Backup the default config:
sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
  1. Edit the configuration file:
sudo nano /etc/snmp/snmpd.conf
  1. Add the following line (replace with your Nagios XI server IP):
rocommunity Str0ngC0mmunity 10.25.5.12
  1. Restart SNMP:
sudo systemctl restart snmpd.service

SNMP v3 Configuration (More Secure)

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

Step 3: Configure Firewall Rules

If firewalld is active:

sudo firewall-cmd --zone=public --add-port=161/udp --permanent
sudo firewall-cmd --reload

Confirm the rule:

sudo firewall-cmd --list-ports

Step 4: Enable SNMP on Boot

sudo systemctl enable snmpd.service

Step 5: Test SNMP Communication

Run from 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:

iso.3.6.1.2.1.1.1.0 = STRING: "Linux almalinux 9 ..."

If no output appears, verify SNMP configuration and firewall.

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

1. Log into Nagios XI.

2. Go to Configure > Run a configuring wizard.

Screenshot 2025 03 12 083824 9
configuring wizard

3. Select Linux SNMP wizard.

Linux SNMP 7
Linux SNMP

4. Enter AlmaLinux 9 IP and SNMP settings (community string or SNMP v3 credentials).

Linux SNMP step 1 7
AlmaLinux 9 credentials

5. Choose metrics (CPU, memory, disk, processes).

6. Apply configuration and verify monitoring.

Common Issues & Fixes

SNMP Not Running

sudo journalctl -u snmpd --no-pager | tail -20
sudo systemctl restart snmpd.service

Host Appears “Down” in Nagios XI

sudo firewall-cmd --list-ports
sudo systemctl status snmpd

SNMP Credential Errors

  • Confirm SNMP version and credentials in both AlmaLinux and Nagios XI
  • Restart SNMP after any changes

Conclusion

You’ve successfully configured AlmaLinux 9 for SNMP monitoring in Nagios XI. This setup allows for secure, agentless tracking of system metrics in real-time. For advanced use, explore custom SNMP OIDs or additional Nagios XI plugins.

For support:

Share: