Setting Up and Monitoring Arch Linux 2024 with NCPA in Nagios XI

Keeping track of your Linux servers is vital for ensuring smooth performance, preventing downtime, and identifying issues before they become critical. Nagios Cross-Platform Agent (NCPA) is a flexible and efficient solution that simplifies monitoring on Arch Linux 2024, integrating seamlessly with Nagios XI.
Unlike traditional monitoring solutions that require multiple agents for different metrics, NCPA provides a unified monitoring approach, offering real-time insights into CPU usage, memory, disk space, network traffic, and more. Whether you’re running a personal server or managing an enterprise infrastructure, this guide will walk you through the installation and configuration of NCPA on Arch Linux 2024 so you can maximize system performance.
Note: NCPA lacks an official Arch Linux package. This guide adapts an RHEL-compatible RPM or source build, verified as of March 2025.
Prerequisites
Before proceeding, ensure you have:
- A system running Arch Linux 2024 with root or sudo privileges.
- Nagios XI installed and accessible, with the NCPA Wizard enabled.
- A stable internet connection for package downloads.
Step 1: Install Required Dependencies
NCPA requires Python and additional libraries. Install them:
sudo pacman -S python python-pip openssl base-devel
pip install requests pyOpenSSL --user
base-devel
: Required for building from source if needed.requests
,pyOpenSSL
: Python modules NCPA may require.
Step 2: Download and Install NCPA
Nagios does not provide an Arch-specific NCPA package, so we will use an RHEL 8 RPM or build from source.
Option 1: Install via RPM (Recommended)
Download the latest EL8 RPM:
cd /tmp
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest-1.x86_64.rpm
Convert and install with rpm2cpio and cpio (since Arch uses pacman
, not rpm
):
rpm2cpio ncpa-latest-1.x86_64.rpm | cpio -idmv
sudo cp -r usr/local/ncpa /usr/local/
Note: Check nagios.com/ncpa for the latest version (e.g., replace 3.1.1).
Option 2: Build from Source (Alternative)
If the RPM fails (e.g., due to library mismatches):
cd /tmp
git clone https://github.com/NagiosEnterprises/ncpa.git
cd ncpa
sudo ./build.sh install
This installs NCPA to /usr/local/ncpa
.
Step 3: Configure NCPA
After installation, configure NCPA by editing its configuration file to set your API token:
sudo nano /usr/local/ncpa/etc/ncpa.cfg
Find the line:
community_string = mytoken
Replace mytoken
with a secure API token of your choice.
Save the file (CTRL + X
, then Y
, and Enter
).
Step 4: Enable and Start the NCPA Service
The RPM/source install does not create a systemd service by default. Create one:
sudo nano /etc/systemd/system/ncpa.service
Add:
[Unit]
Description=Nagios Cross-Platform Agent
After=network.target
[Service]
ExecStart=/usr/local/ncpa/ncpa_listener --config /usr/local/ncpa/etc/ncpa.cfg
Restart=always
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable ncpa
sudo systemctl start ncpa
Verify:
sudo systemctl status ncpa
Step 5: Configure Firewall Rule
If UFW or another firewall is enabled on your system, allow traffic on port 5693 (default NCPA port):
sudo ufw allow 5693/tcp
sudo ufw reload
For iptables, run:
sudo iptables -I INPUT -p tcp --dport 5693 -j ACCEPT
sudo iptables-save > /etc/iptables/iptables.rules
Confirm firewall rules:
sudo iptables -L -n
Step 6: Test NCPA Installation
After configuring the firewall, confirm that NCPA is accessible by navigating to:
https://<NCPA_IP_Address>:5693/
Since NCPA uses a self-signed certificate, your browser may display a warning. Click Advanced > Proceed to continue.
You should see the NCPA login page. Enter the API token you configured earlier and click Log In.
Step 7: Add Arch Linux 2024 Host to Nagios XI Using NCPA Wizard
1. Log in to Nagios XI.
2. Navigate to Configure > Run a configuring wizard.

3. Search for and select NCPA.

4. Enter the Arch Linux 2024 server’s IP address and API token.

5. Click Next, select the system metrics to monitor (CPU, memory, disk, network traffic, etc.).
6. Apply the configuration and verify that Nagios XI is collecting data.
Common Issues & Fixes
NCPA Service is Not Running
- Check logs for errors:
sudo journalctl -u ncpa --no-pager | tail -20
- Restart NCPA if necessary:
sudo systemctl restart ncpa
Host Appears “Down” in Nagios XI
- Check firewall rules:
sudo ufw status
- Ensure NCPA is running:
sudo systemctl status ncpa
- Verify Nagios XI configuration
Incorrect API Token Error
- Confirm the correct API token is set in
ncpa.cfg
- Restart the NCPA service after changes
Conclusion
You have successfully installed and configured NCPA on Arch Linux 2024 for monitoring with Nagios XI. This setup allows efficient tracking of system performance metrics and ensures proactive issue resolution.
For further assistance, refer to the Nagios Support Forum or the Nagios Knowledgebase.