Comprehensive Guide to Monitoring RHEL 7 with SNMP in Nagios XI

Picture of Ayub Huruse
Ayub Huruse
REHL 7

Maintaining the health and performance of your RHEL 7 servers is essential for a stable IT environment. SNMP (Simple Network Management Protocol) offers a streamlined, agentless approach to monitoring, making it an efficient choice for integrating with Nagios XI.

In this guide, you’ll learn how to set up and configure SNMP on RHEL 7, allowing Nagios XI to track key system metrics effortlessly using its built-in SNMP monitoring capabilities.

Prerequisites

Ensure you have the following before starting:

  • A RHEL 7 system with root or sudo privileges
  • Nagios XI installed and accessible
  • SNMP Wizard enabled in Nagios XI
  • Network access between the RHEL 7 server and Nagios XI

Step 1: Install SNMP on RHEL 7

1. To install SNMP and the required libraries, run:

sudo dnf install net-snmp net-snmp-utils -y

2. After installation, verify the installed version:

snmpd -v

Step 2: Configure SNMP Access

SNMP v2c Configuration

Backup config:

sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak

Create a new config:

echo 'rocommunity Str0ngC0mmunity 10.25.5.12' > /etc/snmp/snmpd.conf

Replace Str0ngC0mmunity and 10.25.5.12 accordingly.

Restart SNMP:

systemctl restart snmpd.service

SNMP v3 Configuration

Stop service:

systemctl stop snmpd.service

Create user:

sudo net-snmp-create-v3-user -ro -a SHA -A Str0ng@uth3ntic@ti0n -x AES -X Str0ngPriv@cy nagios

Start service:

sudo systemctl restart snmpd.service

Step 3: Configure Firewall Rules

Allow SNMP traffic:

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

Verify:

firewall-cmd --list-ports

Step 4: Enable SNMP on Boot

sudo systemctl enable snmpd.service

Step 5: Test SNMP Communication

From Nagios XI server:

SNMP v2c:

snmpwalk -v2c -c Str0ngC0mmunity 10.25.5.12

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 rhel7 3.10.0-1160.el7.x86_64"

If no data is returned, check firewall and SNMP config.

Step 6: Add RHEL 7 Host to Nagios XI

1. Log in to Nagios XI.

2. Navigate to Configure > Run a configuring wizard.

3. Select Linux SNMP wizard.

Linux SNMP 5
Linux SNMP

4. Enter the RHEL 7 server’s IP address and SNMP credentials.

Linux SNMP step 1 5
REHL 7 Credentials

5. Select metrics to monitor (CPU, memory, disk, network traffic, etc.).

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

Common Issues & Fixes

SNMP Service is Not Running

1. Check logs for errors:

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

2. Restart SNMP if necessary:

systemctl restart snmpd.service

Host Appears “Down” in Nagios XI

1. Confirm SNMP is running:

systemctl status snmpd

2. Check if port 161 is open:

firewall-cmd --list-ports

3. Verify SNMP credentials in Nagios XI.

Conclusion

You’ve now configured SNMP on RHEL 7 for agentless monitoring in Nagios XI. This setup improves visibility into your server’s health and performance.

For additional resources:

Share: