How to Monitor Rocky Linux 9 Using NCPA with Nagios XI
Efficient server monitoring is crucial for maintaining optimal system performance and minimizing downtime. The Nagios Cross-Platform Agent (NCPA) is a lightweight, agent-based tool that simplifies real-time monitoring for Linux systems like Rocky Linux 9. Unlike SNMP, NCPA leverages a secure, RESTful API to collect detailed system metrics, making it a powerful and secure monitoring solution for integration with Nagios XI.
This guide walks you through the installation and configuration process of NCPA on Rocky Linux 9, enabling comprehensive system monitoring through Nagios XI.
Prerequisites
Before proceeding, ensure you have:
- A Rocky Linux 9 system with root or sudo privileges
- Nagios XI installed and accessible, with the NCPA Wizard enabled
- A stable internet connection for package downloads
- SELinux set to
enforcingorpermissive(check withgetenforce; adjust if needed)
Step 1: Install the Nagios Repository
Install the Nagios repository to access NCPA packages:
sudo rpm -Uvh https://repo.nagios.com/nagios/9/nagios-repo-9-1.el9.noarch.rpm
sudo yum update -yThen refresh the package list:
sudo dnf clean all
sudo dnf update -yStep 2: Install NCPA on Rocky Linux 9
Install the NCPA agent:
sudo dnf install ncpa -yVerify the installation:
rpm -q ncpaExpected output: ncpa-<version>.el9.x86_64
Step 3: Configure NCPA
Edit the configuration file to set your API token:
sudo nano /usr/local/ncpa/etc/ncpa.cfgLocate:
community_string = mytokenReplace with a strong, unique value:
community_string = Str0ngT0k3n2025Replace mytoken with a secure token like Str0ngT0k3n2025. Save and exit.
Step 4: Enable and Start NCPA Service
Enable and start the NCPA service:
sudo systemctl enable ncpa
sudo systemctl start ncpa
sudo systemctl status ncpaEnsure the output shows active (running).
Step 5: Configure Firewall Rules
Allow traffic to NCPA on port 5693:
sudo firewall-cmd --zone=public --add-port=5693/tcp --permanent
sudo firewall-cmd --reloadCheck the rule:
sudo firewall-cmd --list-portsStep 6: Test NCPA Installation
Visit the NCPA web interface:
https://<RockyLinux9-IP>:5693/Accept the certificate warning. Enter your API token to log in.
Step 7: Add Rocky Linux 9 Host to Nagios XI Using NCPA Wizard
1. Log into Nagios XI.
2. Go to Configure > Configuration Wizards.
3. Choose NCPA.

4. Enter the Rocky Linux 9 server’s IP and token.

5. Click Next, choose system metrics (CPU, memory, disk, etc.).
6. Complete the wizard and apply the configuration.
Common Issues & Fixes
NCPA Not Running
Check logs:
sudo journalctl -u ncpa --no-pager | tail -20Restart NCPA:
sudo systemctl restart ncpaHost Appears Down in Nagios XI
Check firewall:
sudo firewall-cmd --list-portsVerify NCPA is running:
sudo systemctl status ncpaIncorrect API Token Error
Ensure the token matches ncpa.cfg, then:
sudo systemctl restart ncpaConclusion
You have successfully installed and configured NCPA on Rocky Linux 9 for monitoring with Nagios XI. This setup allows real-time visibility and proactive performance monitoring.
For further help:



