Comprehensive Guide to Monitoring Oracle Linux 9 with NCPA in Nagios XI

Picture of Ayub Huruse
Ayub Huruse
Oracle Linux 9

Efficient Linux server monitoring is essential for ensuring system stability, performance, and proactive issue resolution. The Nagios Cross Platform Agent (NCPA) offers a powerful, agent-based solution for monitoring Oracle Linux 9 with Nagios XI, providing deep insights into CPU usage, memory, disk space, and system processes.

This guide walks you through the step-by-step installation and configuration of NCPA on Oracle Linux 9, enabling seamless integration with Nagios XI for real-time monitoring and proactive alerts.

Prerequisites

Before proceeding, ensure the following:

  • A system running Oracle Linux 9 with root or sudo privileges.
  • Nagios XI installed and accessible, with the NCPA Wizard enabled.
  • A stable internet connection for package downloads.

Step 1: Install NCPA on Oracle Linux 9

There are two methods to install NCPA on Oracle Linux 9: using the Nagios repository or manually installing the RPM package.

Method 1: Using the Nagios Repository (Recommended)

To install NCPA using the Nagios repository, follow these steps:

1. Install the repository:

sudo rpm -Uvh https://repo.nagios.com/nagios/9/nagios-repo-9-2.el9.noarch.rpm

Note: Verify the latest version at repo.nagios.com if 9-2 is outdated.

2. Enable required repositories:

sudo yum install epel-release -y
sudo yum config-manager --set-enabled ol9_codeready_builder

3. Update your package list:

sudo yum update -y

4. Install NCPA:

sudo dnf install ncpa -y

5. Verify the installation:

 rpm -q ncpa

    Expected output: ncpa-3.1.1-1.el9.x86_64 (version may vary).

    Method 2: Manual RPM Installation

    If you prefer to install NCPA manually, follow these steps:

    1. Download the latest NCPA RPM package:

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

    Note: Check nagios.com/ncpa for the latest version.

    2. Install the package using rpm:

    sudo rpm -ivh /tmp/ncpa-latest.rpm

    Step 2: Configure NCPA

    After installation, configure NCPA by editing its configuration file to set your API token:

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

    Find the line:

    community_string = mytoken

    Replace mytoken with a secure API token of your choice.

    Save the file (CTRL + X, then Y, and Enter).

    Step 3: Enable and Start the NCPA Service

    Restart and enable the service:

    sudo systemctl restart ncpa_listener
    sudo systemctl enable ncpa_listener

    Check if the service is running:

    sudo systemctl status ncpa

    Look for Active: active (running). Note: The service is ncpa, not ncpa_listener.

    Step 4: Configure Firewall Rules

    If firewalld is enabled on your system, allow traffic on port 5693 (default NCPA port):

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

    Confirm firewall rules:

    sudo firewall-cmd --list-ports

    Step 5: Test NCPA Installation

    After configuring the firewall, confirm that NCPA is accessible by navigating to:

    https://<NCPA_IP_Address>:5693/

    Since NCPA uses a self-signed certificate, your browser may display a warning. Click Advanced > Proceed to continue.

    You should see the NCPA login page. Enter the API token you configured earlier and click Log In.

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

    Step 6: Add Oracle Linux 9 Host to Nagios XI Using NCPA Wizard

    1. Log in to Nagios XI.

    2. Navigate to Configure > Run a configuring wizard.

    Screenshot 2025 03 12 083824 3
    Configuration Wizards

    3. Search for and select NCPA.

    NCPA 2
    NCPA

    4. Enter the Oracle Linux 9 server’s IP address and API token.

    Screenshot 2025 03 18 074857
    Oracle Linux 9 Credentials

    5. Click Next, select the system metrics to monitor (CPU, memory, disk, network traffic, etc.).

    6. Apply the configuration and verify that Nagios XI is collecting data.

      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

      Conclusion

      You have successfully installed and configured NCPA on Oracle Linux 9 for monitoring with Nagios XI. This setup allows efficient tracking of system performance metrics and ensures proactive issue resolution.

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

      Share: