Installing pnp4nagios with nagios integration

Notes

pnp4nagios is a nagios addon which collects performance data and stores it into rrd databases to generate nice performance graphs, like this one:

PNP4Nagios




We need to install the addon and modify some nagios settings to let it work. This documentation is for Debian Wheezy. For more information visit www.pnp4nagios.org.

Installation

Install the pnp4nagios

Configuration

Now we need to modify some nagios settings.

Nagios is designed to allow plugins to return optional performance data in addition to normal status data, as well as allow you to pass that performance data Nagios is designed to allow plugins to return optional performance data in addition to normal status data, as well as allow you to pass that performance data to external applications, in our case pnp4nagios, for processing. That means we need to change the process_performance_data option from the default 0 (Don’t process performance data) to 1 (Process performance data).

pnp4nagios expect the host and service performance data in the directory /var/spool/pnp4nagios/nagios (the path is set as default in the /etc/pnp4nagios/nagios.cfg file).

Set the template like below for how data is written to the performance data files.

We need to let pnp4nagios process the performance data, so change the processing command and the timeout interval for it

Create the pnp4nagios action_url service and host object. Later we can only add host-pnp or service-pnp to our services and hosts to implement the pnp4nagios graphs.

Change the npcd init.d setting and allow NPCD to start.

Add service-pnp to enable the pnp4nagios graph on your services

As example add the pnp4nagios graph to the CPU service check on localhost

Add host-pnp to enable the pnp4nagios graph on your hosts

As example add the pnp4nagios graph to the host localhost

If you have done all the configuration restart nagios and start npcd:

Now you should see the graph button on the services and hosts in the nagios webinterface:

pnp4nagtios Button

 

You need only to add the host-pnp or service-pnp template to your hosts or services like above to add the pnp4nagios graph function.