Monitoring a Linux Machine with Nagios XI & NCPA

Last week we discussed monitoring a Windows machine with NCPA and Nagios XI to make sure that the server was functioning properly.  In order to showcase the cross-platform capabilities of NCPA (Nagios Cross-Platform Agent) we decided it would be a good idea to show how to monitor a Linux machine as well.  In this article I will show you how easy it is to monitor a Linux box using the same exact agent that we used to monitor the Windows box last week.  Here’s how you do it.

1. Installing and configuring NCPA on the remote box

Instructions on installing NCPA can be found here: NCPA Installations Instructions. For more info on acquiring the correct RPM packages for your Linux distro, please check our documentation here: Finding the Right RPM

Run the following commands from the command line as root:

Note: For my example, I used CentOS 6.5, 64-bit, so I ran:

Next, you will have to edit the “community_string” in the NCPA config file. The “community_string” is the token that you will use to log into the agent and also allows the Nagios XI server to communicate with the NCPA agent. This process is comparable to entering a token in the GUI installer when monitoring a Windows machine.

To change the default value of the “community_string”, edit the ncpa.cfg file located in the /usr/local/ncpa/etc/ncpa.cfg directory. We suggest choosing something secure. Then, restart the “ncpa_listener” by running the following commands so that the changes can take effect:

Check if the ncpa_listener is indeed running:

If the ncpa_listener is running, you shouled see something like this:

Step 2 – Testing your installation

Open a browser, and go to the NCPA agent site to confirm it’s running:

https://<remote box ip address>:5693/api

You should see the login screen that looks something like this:

NCPA Login Screen

This is where you will need to enter the community_string (token) that we edited in the previous step.  Once you log in, you will see a page similar to this one that shows the following agent information:

NCPA Agent Information
You can then click on See Live Stats to see the metrics on the Windows box. Each graph show in this view is a metric that can be monitored by Nagios XI.

NCPA Service Stats

Step 3 – Running the NCPA wizard on the Nagios XI box

From the Nagios XI web interface, go to:  Configure –> Run the Monitoring Wizard –> NCPA Agent.

NCPA Monitoring Wizard Icon

We’re using NCPA as an active agent, so all we have to enter in step 2 of the Wizard is the IP address of the remote Linux machine and the community_string (token) we edited in step 1 of the configuration. This will allow Nagios XI to communicate with the NCPA agent on the Linux machine.

NCPA Monitoring Wizard

The last step of the wizard asks you which services you wish to monitor.  Click Apply and wait for Nagios XI to schedule the checks.  Once the checks are received, you’ll be able to view them in the Service Status dashboard.  The screenshot below shows successful checks from NCPA.

NCPA Service Status Dashboard

NCPA is a powerhouse agent and has many other use case scenarios. For more information on ways to use NCPA, view the NCPA Documentation or visit our support forums.


Happy Monitoring!

0 Responses to “Monitoring a Linux Machine with Nagios XI & NCPA”

Comments are currently closed.