Step-by-Step Guide: Monitoring Oracle Linux 8 with NCPA in Nagios XI

Picture of Ayub Huruse
Ayub Huruse
Oracle Linux 8

Maintaining the health and performance of Linux servers is crucial for ensuring seamless IT operations. The Nagios Cross-Platform Agent (NCPA) offers a streamlined monitoring solution for Oracle Linux 8, delivering real-time insights into critical system metrics such as CPU usage, memory consumption, and disk activity. By leveraging NCPA, administrators can proactively detect and resolve potential issues before they impact performance.

In this guide, we’ll walk you through the step-by-step process of installing and configuring NCPA on Oracle Linux 8, enabling seamless integration with Nagios XI for proactive monitoring and management.

Prerequisites

Before starting, ensure you have:

  • A system running Oracle Linux 8 with root or sudo privileges.
  • Nagios XI installed and accessible, with the NCPA Wizard enabled.
  • A stable internet connection for downloading necessary packages.

Step 1: Install NCPA on Oracle Linux

There are two methods to install NCPA on Oracle Linux 8: 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/8/nagios-repo-8-2.el8.noarch.rpm

2. Enable required repositories:

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

3. Update your package list:

sudo yum update -y

4. Install NCPA:

sudo yum install ncpa -y

5. Verify the installation:

rpm -q ncpa

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

2. Install the package using RPM:

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

Step 2: Configure NCPA

After installation, configure NCPA by setting the API token:

1. Edit the NCPA configuration file:

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

2. Set the API token: Locate the line:

community_string = mytoken

Replace mytoken with a secure token of your choice, for example:

community_string = Str0ngT0k3n

3. Save and close the file.

Step 3: Enable and Start the NCPA Service

Ensure that NCPA starts on boot and is running:

1. Enable NCPA to start on boot:

sudo systemctl enable ncpa

2. Start the NCPA service:

sudo systemctl start ncpa

3. Verify the service status:

sudo systemctl status ncpa

Step 4: Configure Firewall Rules

If a firewall is enabled, allow traffic on the NCPA port (default is 5693):

1. Open port 5693:

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

2. Reload the firewall to apply changes:

sudo firewall-cmd --reload

3. Confirm the port is open:

sudo firewall-cmd --list-ports 

Ensure that 5693/tcp is listed.

Step 5: Test NCPA Installation

Verify that NCPA is functioning correctly:

1. Access the NCPA web interface: Open a web browser and navigate to:

https://<Oracle_Linux_8_IP>:5693/

2. Handle security warning: Since NCPA uses a self-signed certificate, your browser may display a security warning. Proceed by clicking Advanced and then Accept the Risk and Continue.

3. Log in to NCPA: Enter the API token you configured earlier and click Log In. You should see the NCPA dashboard displaying system information.

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

1. Log in to Nagios XI.

2. Navigate to the NCPA wizard: Go to Configure > Run a configuring wizard, search for NCPA, and select it.

NCPA 3
NCPA

3. Enter host details: Provide the IP address of the Oracle Linux 8 server and the API token.

Oracle
Oracle Linux 8 Credentials

4. Select services to monitor: Choose the metrics you wish to monitor, such as CPU usage, memory usage, disk usage, and network interfaces.

5. Finalize the configuration: Complete the wizard and apply the configuration. Nagios XI will start monitoring the Oracle Linux 8 host using NCPA.

Common Issues & Troubleshooting

NCPA Service Not Running

  • Check service status:
sudo systemctl status ncpa
  • Restart the service if it’s not running:
sudo systemctl start ncpa

Firewall Blocking NCPA Port

  • Verify firewall settings:
sudo firewall-cmd --list-ports
  • Ensure port 5693 is open. If not, add it and reload the firewall:
sudo firewall-cmd --zone=public --add-port=5693/tcp --permanent 
sudo firewall-cmd --reload

Unable to Access NCPA Web Interface

  • Check if NCPA is listening on the correct port:
sudo netstat -tuln | grep 5693
  • Ensure there are no network issues preventing access.

Conclusion

By following this guide, you have successfully installed and configured NCPA on Oracle Linux 8 for monitoring with Nagios XI. This setup enables comprehensive monitoring of system performance metrics, aiding in proactive system management.

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

Share: