Monitoring Void Linux with NCPA in Nagios XI: A Step-by-Step Guide


Void Linux is a lightweight, rolling-release Linux distribution known for its runit init system and independence from systemd. While it does not support RPM or DEB packages directly, NCPA (Nagios Cross-Platform Agent) can still be installed manually. This guide walks you through installing and configuring NCPA on Void Linux and integrating it with Nagios XI for centralized monitoring of system metrics like CPU, memory, disk, and network usage.
Prerequisites
- Void Linux system with
sudo
or root privileges. - A Nagios XI instance with network access to the Void Linux host.
- Network port 5693/tcp open between both systems.
- Basic packages installed:
curl
,rpmextract
,python3
,ncurses-compat-libs
, andcpio
.
Step 1: Install Required Tools
Void Linux doesn’t natively support RPM packages, but rpmextract and cpio allow extraction of the NCPA RPM:
sudo xbps-install -Sy curl rpmextract cpio python3 ncurses-compat-libs
- rpmextract provides rpm2cpio, and ncurses-compat-libs ensures compatibility for NCPA’s dependencies.
Verify Installation:
curl --version
rpm2cpio --version
cpio --version
python3 --version
Step 2: Download and Extract the NCPA RPM
- Create a working directory:
mkdir -p ~/ncpa && cd ~/ncpa
- Download the latest NCPA RPM:
curl -O https://assets.nagios.com/downloads/ncpa3/ncpa-latest-1.x86_64.rpm
- Extract the contents:
rpm2cpio ncpa-latest-1.x86_64.rpm | cpio -idmv
Step 3: Copy NCPA Files
Move the extracted files into appropriate directories:
sudo cp -r ./usr/* /usr/
sudo cp -r ./etc/* /etc/
sudo cp -r ./var/* /var/
- Note: Void Linux’s filesystem is mutable, so these files persist across reboots unless manually removed or overwritten by updates.
Step 4: Configure NCPA
Set a secure token for NCPA authentication:
1. Edit the configuration file:
sudo nano /usr/local/ncpa/etc/ncpa.cfg
2. Set a strong token:
- Locate:
community_string = mytoken
- Replace with:
community_string = Str0ngT0k3n2025
- Save and exit (Ctrl+O, Enter, Ctrl+X in nano).
Step 5: Create runit Service for NCPA
Since Void Linux uses runit, create a service manually.
- Create service directory:
sudo mkdir -p /etc/sv/ncpa
- Create the run script:
sudo nano /etc/sv/ncpa/run
Add the following:
#!/bin/sh
exec /usr/local/ncpa/ncpa_listener
- Make it executable:
sudo chmod +x /etc/sv/ncpa/run
- Enable the service:
sudo ln -s /etc/sv/ncpa /var/service/
- Confirm it’s running:
pgrep -f ncpa_listener
Step 6: Open Firewall Port 5693
If using iptables
, run:
sudo iptables -I INPUT -p tcp --dport 5693 -j ACCEPT
Make persistent:
sudo iptables-save > /etc/iptables/rules.v4
Verify:
sudo iptables -L -n | grep 5693
Step 7: Test NCPA Access
Access the NCPA interface:
https://<VoidLinux-IP>:5693/
Login with the token: Str0ngT0k3n2025
Step 8: Configure Nagios XI
- Log into Nagios XI.
- Go to Configure > Configuration Wizards.
- Select NCPA.
- Enter:
- IP: Void Linux IP
- Port:
5693
- Token:
Str0ngT0k3n2025
- Choose metrics (CPU, memory, disk, etc.) and apply the configuration.
Troubleshooting
- Check process:
pgrep -f ncpa_listener
- Check logs:
cat /usr/local/ncpa/var/log/ncpa.log
- Test connectivity:
nc -zv <VoidLinux-IP> 5693
Conclusion
You’ve successfully installed and configured NCPA on Void Linux and integrated it with Nagios XI. Although Void Linux is non-standard in terms of service management and package formats, NCPA works with minor manual setup. For advanced features, explore NCPA’s passive checks or API-based monitoring.
Resources: