Sunday, January 10, 2010

Nagios addon - pnp4nagios

PNP4Nagios is a gem of an add-on; it allows a Nagios administrator to easily add RRD-style graphs and efficient long-term trending ­capabilities to Nagios. This graphing framework makes extensive use of templates and is easy to customize. It consists of a PHP-based front using Kohana framework.



Pnp4nagios uses kohana framework for web frontend and kohana requires php 5.2.x has to be installed. In my previous post I have describe how to upgrade to php 5.2.x on centos which comes with 5.1.x.


System Requirement

Perl >= 5.x
RRDtool
PHP >= 5.2. for the Webfrontend based on Kohana
PHP-extension zlib, session and GD.
Nagios >= 2.x

Installation

Joerg Linge have written excellent documentation for pnp4nagios and using it one can easily install and configure PNP in no time.

In my case I have used the following ./configure line to have rrd data under nagios directories and rest of pnp4nagios goes its own directories in filesystem.

./configure --with-perfdata-logfile=/var/nagios/perfdata.log --with-perfdata-dir=/var/nagios/perfdata --with-perfdata-spool-dir=/var/nagios/spool/perfdata

After installing follow the pnp docs for start generating graphs and web integration with Nagios.

Before going for production use, decide which mode is right for your Nagios installation.

In our case we go with Bulk Mode with NPCD as per docs...

Nagios again uses a temporary file to store the data and executes a command after expiration of a certain time. Instead of immediate processing by process_perfdata.pl the file is moved to a spool directory. As moving a file inside the same filesystem nearly takes no time nagios is able to execute crucial work immediately.
The NPCD daemon (Nagios Performance C Daemon) will monitor the directory for new files and will pass the names to process_perfdata.pl. Processing of performance data is decoupled completely from nagios. NPCD itself is able to start multiple thread for processing the data.

Pages

One of the cool feature of pnp4nagios to have separate pages of graphs for hosts/services on a single page.
Once again Joerg have an excellent docs for configuring pages.

Conclusion


Once installed and configured pnp4nagios provides trending and capacity planning which allows organizations to plan for infrastructure upgrades before outdated systems catch them by surprise.

3 comments:

  1. I have Nagios 3.3.1 along with nrpe 2.1.12 and nagios-plugin version 1.4.15 , pnp4nagios version is 0.6.16 all I have installed and configured on Fedora 16 but it is not generating graphs for some services, it shows the error xml file not found .., any suggestion would be highly appreciated.

    ReplyDelete
  2. I have Nagios 3.3.1 along with nrpe 2.1.12 and nagios-plugin version 1.4.15 , pnp4nagios version is 0.6.16 all I have installed and configured on Fedora 16 but it is not generating graphs for some services, it shows the error xml file not found .., any suggestion would be highly appreciated.

    ReplyDelete
    Replies
    1. Hi, I am afraid I wouldn't be very helpful these days, however i would recommend to check pnp4nagios mailing list https://lists.sourceforge.net/lists/listinfo/pnp4nagios-users. The pnp4nagios author himself supporting on the mailing list.

      Delete