Setting Up NCPA for Monitoring AlmaLinux 8 in 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 AlmaLinux 8. 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 AlmaLinux 8, enabling comprehensive system monitoring through Nagios XI.
Prerequisites
Before proceeding, ensure you have:
- An AlmaLinux 8 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
The recommended method for installing NCPA on AlmaLinux 8 is using the Nagios repository:
sudo rpm -Uvh https://repo.nagios.com/nagios/8/nagios-repo-8-1.el8.noarch.rpm
sudo yum update -yAfter adding the repository, refresh your package list:
sudo dnf clean all
sudo dnf update -yStep 2: Install NCPA on AlmaLinux 8
Install the NCPA agent using:
sudo dnf install ncpa -yVerify installation:
rpm -q ncpaExpected output: ncpa-<version>.el8.x86_64
Step 3: Configure NCPA
Edit the NCPA configuration file to set your API token:
sudo nano /usr/local/ncpa/etc/ncpa.cfgFind the line:
community_string = mytokenReplace mytoken with a strong, unique token (e.g., K9pL3mX7vR2tQ8nJ). Save and close.
Step 4: Enable and Start the NCPA Service
Ensure NCPA runs at boot and starts now:
sudo systemctl enable ncpa
sudo systemctl start ncpa
sudo systemctl status ncpaConfirm active (running) is displayed.
Step 5: Configure Firewall Rules
If firewalld is active, open port 5693:
sudo firewall-cmd --zone=public --add-port=5693/tcp --permanent
sudo firewall-cmd --reloadVerify:
sudo firewall-cmd --list-portsStep 6: Test NCPA Installation
Verify access to NCPA by visiting:
https://<AlmaLinux8-IP>:5693/Accept the browser’s self-signed certificate warning. Enter your API token and log in.
Step 7: Add AlmaLinux 8 Host to Nagios XI Using NCPA Wizard
1. Log into Nagios XI.
2. Navigate to Configure > Configuration Wizards.
3. Search for and select NCPA.

4. Enter the AlmaLinux 8 server’s IP and the API token.

5. Click Next, select system metrics to monitor (CPU, memory, disk, etc.).
6. Apply configuration and verify data collection.
Common Issues & Fixes
NCPA Service is Not Running
Check logs:
sudo journalctl -u ncpa --no-pager | tail -20Restart NCPA if needed:
sudo systemctl restart ncpaHost Appears “Down” in Nagios XI
Check firewall rules:
sudo firewall-cmd --list-portsCheck NCPA status:
sudo systemctl status ncpaVerify Nagios XI configuration.
Incorrect API Token Error
Ensure correct token is set in ncpa.cfg. Restart NCPA after updates:
sudo systemctl restart ncpaConclusion
You have successfully installed and configured NCPA on AlmaLinux 8 for monitoring with Nagios XI. This setup enables efficient tracking of system performance metrics and supports proactive issue resolution.
For additional support:



