Step-by-Step Guide to Monitoring Fedora 40 with NCPA in Nagios XI

Picture of Ayub Huruse
Ayub Huruse
Fedora 40

Monitoring Fedora 40 with Nagios XI provides real-time visibility into system performance, resource utilization, and potential issues, ensuring proactive system management. The Nagios Cross-Platform Agent (NCPA) simplifies this process by offering a versatile, all-in-one monitoring solution that collects system metrics, executes custom scripts, and seamlessly transmits data to Nagios XI.

In this guide, we’ll walk you through the step-by-step installation and configuration of NCPA on Fedora 40, enabling efficient and comprehensive monitoring through Nagios XI.

Step 1: Installing NCPA on Fedora 40

Since Fedora 40 is not explicitly listed in the official NCPA documentation, we will install NCPA manually using the latest available RPM package.

1.1 Download the NCPA RPM Package

Start by downloading the latest NCPA package for Fedora-compatible systems.

cd /tmp
wget https://assets.nagios.com/downloads/ncpa3/ncpa-latest.el7.x86_64.rpm

1.2 Install the RPM Package

Use the dnf package manager to install the downloaded package.

sudo dnf install ./ncpa-latest.el7.x86_64.rpm -y

1.3 Verify Installation

Check the installed version:

rpm -q ncpa

Expected output: ncpa-3.1.1-1.el8.x86_64.

1.4 Start and Enable NCPA Service

Once installed, start the NCPA Listener service and enable it to run at boot.

sudo systemctl start ncpa_listener
sudo systemctl enable ncpa_listener

Note: The service is typically ncpa, not ncpa_listener. Verify with systemctl list-units | grep ncpa.

Step 2: Configuring NCPA

After installation, configure NCPA to allow Nagios XI to communicate with it.

2.1 Set Up Authentication Token

Edit the NCPA configuration file to define an authentication token.

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

Locate the following line:

community_string = mytoken

Replace with a strong, unique token (e.g., K9pL3mX7vR2tQ8nJ):

community_string = K9pL3mX7vR2tQ8nJ

Save and exit (Ctrl+O, Enter, Ctrl+X).

2.2 Restart NCPA for Changes to Take Effect

sudo systemctl restart ncpa_listener

2.3 Configure Firewall Rules

Allow Nagios XI to communicate with NCPA over port 5693.

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

Verify:

sudo firewall-cmd --list-ports

Step 3: Adding Fedora 40 to Nagios XI

Now that NCPA is set up, integrate it with Nagios XI for active monitoring.

3.1 Access Nagios XI

  1. Log in to Nagios XI.
  2. Navigate to Configure → Configuration Wizards.
  3. Search for and select NCPA.
NCPA
NCPA

3.2 Add Fedora 40 Host

  1. Enter the hostname or IP address of your Fedora 40 machine.
  2. Provide the NCPA authentication token (Str0ngT0k3n).
  3. Click Next.
rhel
Fedora 40 NCPA Config step 1

3.3 Define Monitoring Checks

  • Select system metrics like CPU Usage, Memory Usage, Disk Space, Network Usage.
  • Configure thresholds for warning and critical alerts.

3.4 Save and Apply Configuration

  • Click Finish to add the host.
  • Apply the configuration to start monitoring.

Step 4: Verify Monitoring

4.1 Check NCPA Web Interface

Open a browser and visit:

https://<Fedora40-IP>:5693/

Log in using the authentication token to confirm NCPA is running.

4.2 View Host Status in Nagios XI

  1. Go to Home → Service Status.
  2. Locate your Fedora 40 host.
  3. Ensure checks return valid results.
Screenshot 2025 03 17 075227
Host status Detail

Step 5: Common Issues & Fixes

NCPA Service is Not Running

Check logs for errors:

sudo journalctl -u ncpa --no-pager | tail -20

Restart NCPA if necessary:

sudo systemctl restart ncpa

Host Appears “Down” in Nagios XI

Check firewall rules:

sudo firewall-cmd --list-ports

Ensure NCPA is running:

sudo systemctl status ncpa

Verify Nagios XI configuration.

Incorrect API Token Error

Confirm the correct API token is set in ncpa.cfg.

Restart the NCPA service after changes:

sudo systemctl restart ncpa

Conclusion

By installing and configuring NCPA, Fedora 40 is now actively monitored in Nagios XI. This setup enables real-time insights and proactive issue resolution for your system. You can further enhance monitoring by creating custom checks using NCPA’s API.

For further assistance, refer to the Nagios Support Forum or the Nagios Knowledgebase.

Share: