Easily Install NCPA on CentOS 8 and Monitor with Nagios XI

Picture of Tucker Falen
Tucker Falen
centos 8

Nagios Cross-Platform Agent (NCPA) is a robust monitoring agent that allows you to monitor system metrics, services, and processes across different operating systems. This guide will walk you through the steps to install NCPA on CentOS 8.

Prerequisites

  • A CentOS 8 system with root or sudo privileges
  • Access to the internet
  • A running Nagios server

Step 1: Update System Packages

Before installing any software, it’s best to update your system:

sudo dnf update -y

Step 2: Download NCPA Package

The official NCPA package for CentOS 8 is available on the Nagios website. You can download it using wget:

wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.el8.x86_64.rpm

Step 3: Install NCPA

Use the dnf package manager to install the downloaded RPM package:

sudo dnf install -y ncpa-latest.el8.x86_64.rpm

This command installs NCPA along with its dependencies.

Step 4: Configure NCPA

The main configuration file for NCPA is located at:

/etc/ncpa/ncpa.cfg

Open the file with a text editor, such as nano:

sudo nano /etc/ncpa/ncpa.cfg

Set the api_token value to a secure string, as it is required for communication between NCPA and the Nagios server:

api_token = YOUR_SECURE_API_TOKEN

Save the file and exit.

Step 5: Start and Enable NCPA Service

Once configured, start the NCPA services and enable them to run at boot:

sudo systemctl enable --now ncpa_listener
sudo systemctl enable --now ncpa_passive

Step 6: Configure Firewall Rules (If Applicable)

If you have firewalld enabled, allow NCPA through the firewall:

sudo firewall-cmd --permanent --add-port=5693/tcp
sudo firewall-cmd --reload

Step 7: Verify NCPA Installation

To check if NCPA is running, use the following command:

sudo systemctl status ncpa_listener ncpa_passive

Additionally, you can test API access via curl:

curl https://localhost:5693/api --insecure

If everything is set up correctly, you should receive a JSON response.

Monitoring with Nagios

On your Nagios web GUI, click Run a wizard and find the NCPA wizard.

Screenshot 2025 02 11 102857 2
Wizards page

Type in the Address of your machine running NCPA. You can leave the Port as default. Enter the Token that you created earlier and click Next, and Finish with Defaults.

Screenshot 2025 02 11 103046 1 edited
Config wizard

Conclusion

You have successfully installed and configured NCPA on CentOS 8. This agent allows you to monitor system performance and services using Nagios. Want Nagios notifications in Slack or Discord? Click to find out how.

Share: