Installing Nagios Cross-Platform Agent on Arch Linux 2025


Nagios is a popular open-source monitoring system that helps administrators keep track of the health and performance of various systems, services, and networks. One of the most useful tools in the Nagios ecosystem is the Nagios Cross-Platform Agent (NCPA), which allows you to monitor multiple operating systems from a single agent, including Linux, Windows, and macOS.
This article will guide you through installing the Nagios Cross-Platform Agent (NCPA) on Arch Linux (version 2025.03.01) and configuring it in Nagios XI for centralized monitoring.
Prerequisites
Before we begin, ensure that you have the following:
- A working Arch Linux system: Ensure your Arch Linux installation is up-to-date, and you have sudo privileges.
- Nagios XI installed: Nagios XI should be installed on a separate server, as this will be used to manage and monitor the system where NCPA is deployed.
- Network connectivity: Your Arch Linux system should be able to communicate with the Nagios XI server over the network.
Step 1: Installing Nagios Cross-Platform Agent (NCPA) on Arch Linux
As of March 2025, the NCPA package is not directly available in the Arch Linux repositories, so you will need to manually download and install the agent.
1.1. Download the NCPA Agent
To get the NCPA agent on Arch Linux, follow these steps:
- Install necessary dependencies: First, ensure your system is fully updated, and install the required packages to build NCPA:
sudo pacman -Syu
sudo pacman -S git base-devel python3
2. Clone the NCPA repository: Clone the official Nagios NCPA repository from GitHub:
git clone https://github.com/NagiosEnterprises/ncpa.git
cd ncpa
3. Install NCPA: NCPA can be installed using the following commands. Since Arch Linux uses makepkg
for building packages, you need to create the package manually:
makepkg -si
This command will build and install NCPA, including any required dependencies.
4. Start the NCPA service: Once installed, you can start the NCPA service:
sudo systemctl start ncpa
To enable NCPA to start automatically on boot, use:
sudo systemctl enable ncpa
You can check the status of the NCPA service by running:
sudo systemctl status ncpa
5. Configure the firewall (if applicable): If you are using a firewall, make sure to allow the necessary ports (default is port 5693 for NCPA) to pass through:
sudo ufw allow 5693
1.2. Verify the NCPA Installation
After installing and starting the NCPA service, verify that it’s running properly by accessing the web interface. Open your browser and visit the following URL (replace <arch-linux-ip>
with your actual IP address):
http://<arch-linux-ip>:5693
You should be prompted with a login screen. The default username is nagiosadmin
and the default password is nagios
.
Step 2: Configure NCPA in Nagios XI
Once you have installed and verified that NCPA is running on your Arch Linux system, the next step is to configure it within Nagios XI for centralized monitoring.
2.1. Add Host to Nagios XI
- Log in to Nagios XI: Open your web browser and log in to your Nagios XI server (e.g.,
http://<nagios-xi-ip>/nagiosxi
). - Navigate to the “Configure” menu: From the main dashboard of Nagios XI, go to the
Configure
tab and selectCore Configuration Manager
. - Add a new host: In the Core Configuration Manager, click on
Hosts
in the left-hand menu and then click theAdd New
button. - Host Settings:
- Host Name: Enter a meaningful name for the Arch Linux host (e.g.,
arch-linux
). - Alias: Optionally, provide an alias (e.g.,
Arch Linux System
). - Address: Enter the IP address of your Arch Linux machine (e.g.,
192.168.1.100
). - Host Template: You can either use a predefined template or create a custom template for monitoring NCPA. If using a predefined template, select
Generic Host
.
- Host Name: Enter a meaningful name for the Arch Linux host (e.g.,
- Save the host configuration.
2.2. Add Service for NCPA Monitoring
Now that you’ve added the host, it’s time to add services to monitor specific metrics via NCPA.
- Add Services: After saving the host, navigate to the
Services
section under the host configuration and clickAdd New
. - Service Configuration:
- Service Name: Enter a descriptive name for the service (e.g.,
CPU Usage
orMemory Usage
). - Service Description: Optionally, provide more details.
- Service Type: Select
NCPA
. - Check Command: From the list of check commands, select
check_ncpa.py
orcheck_ncpa.py!<metric>
(replace<metric>
with the desired metric likecpu
,memory
,disk
, etc.). - Additional Arguments: You can customize the command arguments to match your needs, such as the one below and save the service configuration:
- Service Name: Enter a descriptive name for the service (e.g.,
-H <arch-linux-ip> -t <token> -P 5693 -M 'system/uptime'
3. Configure NCPA Token: To make sure the Nagios XI server communicates securely with NCPA, you will need to use the token set during NCPA setup (the default token is nagios
). If you set a custom token, use it in the configuration.
Update the check command in Nagios XI to include this token, like this:
-H <arch-linux-ip> -t nagios -P 5693 -M 'system/uptime'
Below are screenshots of where you’ll go inside Nagios XI when setting up the wizard. Once you have selected the wizard make sure to follow the prompts. You can also select “finish with defaults” after entering in initial information.



2.3. Verify Monitoring
Once you’ve configured the host and services, go back to the Nagios XI dashboard and check the status of the new host and services. If everything is set up correctly, you should begin seeing the system metrics of the Arch Linux machine being reported in real-time. You can also test individual metrics by manually running the NCPA check command from the Nagios XI server:
/usr/local/nagios/libexec/check_ncpa.py -H <arch-linux-ip> -t nagios -P 5693 -M 'system/uptime'
If the configuration is correct, you will receive a status message with the requested metric data.
2.4. Automate Service Checks
To ensure that Nagios XI continuously monitors the Arch Linux system, make sure the services you created are set up to check regularly by setting the appropriate intervals in the service settings (e.g., every 5 minutes).
Step 3: Troubleshooting
If you encounter any issues, here are a few troubleshooting steps:
- Firewall: Ensure that port
5693
is open on both the Arch Linux server and the Nagios XI server. - Token Mismatch: Double-check the token configuration in both Nagios XI and NCPA.
- NCPA Logs: Check the NCPA logs on your Arch Linux system for any error messages. Logs are usually found in
/var/log/ncpa/
.
Conclusion
By following these steps, you should have successfully installed the Nagios Cross-Platform Agent (NCPA) on your Arch Linux system and configured it for monitoring in Nagios XI. NCPA is a powerful and flexible tool for monitoring various system metrics, and when combined with Nagios XI, it provides a comprehensive solution for centralized network monitoring. Keep your system up-to-date and periodically review your Nagios XI configuration to ensure optimal performance.
For further assistance, refer to the Nagios Support Forum or the Nagios Knowledgebase.
For additional customization and advanced features, refer to the official NCPA documentation.