Installing Nagios Cross-Platform Agent on a Fedora 41 Workstation

Picture of Johnny Mengistu
Johnny Mengistu
"Fedora 41" on a blue background with roads.

Nagios Cross-Platform Agent (NCPA) is a powerful monitoring agent that allows you to monitor systems running on various operating systems, including Linux, Windows, and macOS. NCPA is designed to be lightweight, secure, and easy to configure, making it an excellent choice for monitoring your Fedora 41 workstation.

In this article, we will walk you through the steps to install and configure NCPA on a Fedora 41 workstation.

Prerequisites

Before you begin, ensure that you have the following:

  • A Fedora 41 workstation with root or sudo privileges.
  • Access to a terminal or command-line interface.
  • An active internet connection to download the necessary packages.

Step 1: Update Your System

Before installing any new software, it’s a good practice to update your system to ensure that all existing packages are up to date with this script:

sudo dnf update -y

Step 2: Download NCPA

NCPA is not available in the default Fedora repositories, so you will need to download it directly from the Nagios website.

Download NCPA by navigating to the NCPA page and download the latest version of NCPA for Linux. Alternatively, you can use wget to download the package directly from the terminal.

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

Your screen should look something like the one below after running that wget script:

Fedora NCPA Wget Script
Fedora NCPA Wget Script

Step 3: Install NCPA

Once the download is complete, install the package using the dnf package manager. During the installation, you may be prompted to confirm the installation of the package. Type y and press Enter to proceed.

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

During the installation, you may be prompted to confirm the installation of the package. Type y and press Enter to proceed.

Step 4: Configure NCPA

After installation, you’ll need to configure the NCPA agent. The configuration file is located at /usr/local/ncpa/etc/ncpa.cfg. To edit the configuration, you can use the script below:

sudo nano /usr/local/ncpa/etc/ncpa.cfg

Your screen should look similar to the one below after the script:

NCPA Main Config File e1791384306558
NCPA Main Config File

Set a Password for the NCPA API
In the configuration file, look for the API key parameter. This is used to authenticate API requests. You should set a strong password for the API key. It should look like this below:

NCPA Main Config File API Comm String Token rev2
NCPA API Community String

The community string token, by default, might have a series of numbers or it might say my_token. Replace mytoken with a secure API token of your choice. Save the file (CTRL + X, then Y, and Enter).

Step 5: Check, Install, & Enable Firewall (UFW)

As of my knowledge cutoff in October 2023, Fedora does not come with UFW (Uncomplicated Firewall) pre-installed, as it typically uses firewalld as its default firewall management tool. However, if you want to use ufw on Fedora 41 Workstation, you would first need to install it and then check its status. For the purpose of this article we will continue with firewalld.

To check the status of firewalld on Fedora 41, you can use the following command:

sudo systemctl status firewalld

Your screen should look like this:

Fedora 41 Firewall
Fedora 41 Firewall

Step 6: Start and Enable the NCPA Service

To ensure that NCPA runs automatically at startup, you need to enable and start the service.

Start the NCPA service:

sudo systemctl start ncpa_listener

Enable the service to start on boot:

sudo systemctl enable ncpa_listener

Verify that the service is running:

sudo systemctl status ncpa_listener

You should see an output indicating that the service is active and running. Your screen should look like this:

Fedora 41 Enable NCPA Service 1
Fedora 41 Enable NCPA Service

Step 7: Verify NCPA Installation

1. Open a web browser and go to: https://<NCPA_IP_Address>:5693/

2. You will see the error message below saying that site isn’t safe to continue. Simply click Advanced and proceed to the site.

3. On the NCPA login page, enter the community string API token you configured earlier in Step 4 and click Log In.

Web GUI Log In
Web GUI Log In

4. You will be directed to the NCPA Dashboard and your screen should look like the one below. Click See Live Stats to continue.

NCPA Check Status 1
NCPA Check Status
NCPA Dashboard 2
NCPA Dashboard

Step 9: Configure NCPA on Nagios XI

1. Log into Nagios XI.

2. Open the NCPA Wizard by selecting Configure > Run a Monitoring Wizard > NCPA. In the search bar type NCPA to find it easily.

ConfigurationWizard NCPA
NCPA configuration Wizards

3. Enter the IP address, API token, and system you are using (select Generic option).

4. Complete the wizard setup by filling in the rest of the information in the remaining steps to your liking and click Finish, or click Finish w/Defaults.

NCPA Config Info Step1 Generic e1791385909933
NCPA Wizard Step 1

5. After completing the Wizard, Nagios XI should display the monitored host and its services.

6. Navigate to the Host Status Detail page to confirm that the system is being monitored.

NCPA Fedora 41 Host Detail
NCPA Fedora 41 – Host Detail

Conclusion

By following these steps, you have successfully installed and configured NCPA on your Fedora 41 Workstation. NCPA provides a robust and flexible solution for monitoring your system, and its integration with Nagios XI or Nagios Core makes it an invaluable tool for system administrators.

For additional customization and advanced features, refer to the official NCPA documentation.

Additional Resources

Visit Our Website

Visit Nagios Support Forum

Visit Nagios Exchange

Visit Nagios Documentation Hub

Share: