Installing Nagios Cross-Platform Agent on a Fedora 41 Workstation

Picture of Johnny Mengistu
Johnny Mengistu

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 Nagios 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 and Install NCPA

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

  1. Download the NCPA Package: Visit the Nagios NCPA download 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:

2. Install the NCPA Package: 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 3: 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:

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:

The community string token, by default, might have a series of numbers or it might say “my_token”. After making changes press “CTRL and ” then press to confirm your changes and hit Enter to save everything.

Step 5: Check Firewall & Install/Enable Firewalld/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:

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 below:

Step 7: Verify NCPA Installation

  1. This step is optional but recommended. 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. You will then enter the community string API token from earlier in step 4 & click Log In. If you have the token proceed to the next step otherwise go back & retrieve it.
  4. Your screen should look like the ones below after completing each step. Click See Live Stats to continue then you’ll be brought to the NCPA Dashboard.

Step 9: Configure NCPA on Nagios XI

1. Log into Nagios XI and hover your mouse over the gear icon & select Configuration Wizards. Or click the gear icon & then click Configuration Wizards. If you’re using light or dark mode the buttons might be in different locations.

2. In the search bar above like in the picture below look for NCPA and select it

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

4. Fill in the rest of the information to your liking and click Finish or Finish w/Defaults

5. After you are finished click the home icon on the far left and select the green host bar in the middle of the screen like in the picture below.

6. Select the name of the NCPA agent you just created & you will see Host Status Details

Conclusion

By following these steps, you have successfully installed and configured the Nagios Cross-Platform Agent (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 further customization and advanced usage, refer to the official NCPA documentation. Happy monitoring!

Additional Resources

Visit Our Website: https://www.nagios.com

Visit Nagios Support: https://support.nagios.com/

Visit Nagios Exchange: https://exchange.nagios.org/

Share: