Installing Nagios Cross Platform Agent (NCPA) on CentOS 7 and Monitoring with Nagios XI

Picture of Tucker Falen
Tucker Falen
Agent

Monitoring your infrastructure is essential for maintaining system health and performance. The Nagios Cross Platform Agent (NCPA) is a powerful and versatile monitoring agent that allows Nagios to monitor Linux, Windows, and macOS systems with ease. This guide will walk you through installing and configuring NCPA on CentOS 7.

Step 1: Add the Nagios Repository

First, add the Nagios repository to your system to access the NCPA package:

sudo rpm -Uvh https://repo.nagios.com/nagios/7/nagios-repo-7-4.el7.noarch.rpm

Step 2: Install NCPA

Once the repository is added, install NCPA with:

sudo yum install ncpa -y

Step 3: Start and Enable NCPA Services

After installation, start and enable the NCPA services to run at boot:

sudo systemctl enable ncpa
sudo systemctl start ncpa

Step 4: Configure NCPA

The main configuration file for NCPA is located at:

/etc/ncpa/ncpa.cfg

Before making changes, back up the original file:

sudo cp /etc/ncpa/ncpa.cfg /etc/ncpa/ncpa.cfg.bak

Now, edit the configuration file:

sudo nano /etc/ncpa/ncpa.cfg

Locate the [api] section and update the community_string value:

[api]
community_string = YourCommunity

Save and exit the file, then restart the NCPA services:

sudo systemctl restart ncpa_listener
sudo systemctl restart ncpa_passive

Step 5: Adjust Firewall Rules

To allow NCPA traffic, open the necessary ports:

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

Step 6: Verify NCPA Functionality

To check if NCPA is running correctly, open a web browser and navigate to:

https://<server-ip>:5693

Log in using the community string configured earlier. If you see the NCPA web interface, the agent is working correctly.

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 the Nagios Cross Platform Agent (NCPA) on CentOS 7. This setup allows Nagios to monitor the server efficiently, providing real-time insights into system performance and resource utilization. By integrating NCPA with Nagios, you enhance your network monitoring capabilities, ensuring proactive management of system health and performance.

Share: