Rocky Linux 8 Monitoring with NCPA in Nagios XI: A Complete Setup Guide


Ensuring the health and performance of your Rocky Linux 8 servers is crucial for maintaining a stable IT environment. The Nagios Cross-Platform Agent (NCPA) provides a powerful, secure, and efficient way to monitor system metrics in real time using a RESTful API. In this guide, you’ll learn how to install and configure NCPA on Rocky Linux 8, seamlessly integrating it with Nagios XI for proactive monitoring and insightful analytics.
Prerequisites
Before proceeding:
- A Rocky Linux 8 system with sudo/root access
- A Nagios XI server with NCPA Wizard enabled
- Internet access for package downloads
- Port 5693/TCP open in the firewall
Step 1: Install the Nagios Repository
To install NCPA using the Nagios repository:
sudo rpm -Uvh https://repo.nagios.com/nagios/8/nagios-repo-8-1.el8.noarch.rpm
sudo dnf clean all
sudo dnf update -y
Step 2: Install NCPA
Install the agent via the repository:
sudo dnf install ncpa -y
Verify installation:
rpm -q ncpa
Expected: ncpa-<version>.el8.x86_64
Step 3: Configure NCPA
Set your API token:
sudo nano /usr/local/ncpa/etc/ncpa.cfg
Locate:
community_string = mytoken
Replace with a strong, unique value:
community_string = Str0ngT0k3n
Save and exit (Ctrl+O, Enter, Ctrl+X in nano).
Step 4: Start and Enable NCPA
Enable and start the NCPA service:
sudo systemctl enable ncpa
sudo systemctl start ncpa
sudo systemctl status ncpa
Confirm it’s active (running).
Step 5: Configure Firewall
Allow traffic on TCP port 5693:
sudo firewall-cmd --zone=public --add-port=5693/tcp --permanent
sudo firewall-cmd --reload
Verify:
sudo firewall-cmd --list-ports
- Ensure 5693/tcp is listed.
Step 6: Test NCPA Access
Open your browser and go to:
https://<RockyLinux8-IP>:5693/
Accept the certificate warning and log in with your token.
Step 7: Add Rocky Linux 8 Host to Nagios XI
1. Log into Nagios XI
2. Go to Configure > Configuration Wizards
3. Select NCPA

4. Enter:
- IP:
<RockyLinux8-IP>
- Token:
Str0ngT0k3n

5. Choose metrics (CPU, Memory, Disk, etc.)
6. Apply the configuration
Common Issues & Fixes
NCPA Not Running
sudo journalctl -u ncpa --no-pager | tail -20
sudo systemctl restart ncpa
Host Down in Nagios XI
- Confirm firewall:
sudo firewall-cmd --list-ports
- Check service:
sudo systemctl status ncpa
Invalid Token
Ensure correct token in ncpa.cfg
and restart:
sudo systemctl restart ncpa
Conclusion
You’ve now configured NCPA on Rocky Linux 8 for integration with Nagios XI. For further support: