Tuesday, January 22, 2008

Installing pnp ( PNP is not PerfParse ) at CentOs 5

Because nagios not come with tools to generate chart, so I need another tools to this job.
I found several tools for this task such as perfparse, NagiosGrapher, nagiosstat, and pnp.
After try to install some of this tools I choose to use pnp. I use pnp because it's easy to install.
To install pnp first read the documentation then proceed with the installation step

./configure --sysconfdir=/etc/nagios --datadir=/usr/share/nagios/pnp --bindir=/usr/bin --localstatedir=/var/nagios

you will see the configuration summary

make all && make install

Then you finish with the installation.

Now we gonna edit our configuration files.

For the first step edit the nagios configuration file, at my system it is the nagios.cfg, edit the following lines
Now edit the command definition file at my system it's called commands.cfg, edit the process-service-perfdata definition
at the command-line section set the value to /usr/bin/perl /usr/local/nagios/libexec/process_perfdata.pl.

here the process-service-perfdata section at my commands.cfg

According to pnp documentation process_perfdata.pl can not start under ePN(embeded Perl Nagois), that's why we must put the perl full path.

This type of configuration is default mode. There are others type of configuration mode, they are Bulk Mode and Bulk Mode with NPCD.

Create 2 other files serviceextinfo.cfg and hostextinfo.cfg. Both file name must match with the file name at Extended host/service info definitions section in the nagios configuration file (see above).

to create both files use this command "touch serviceextinfo.cfg hostextinfo.cfg"

Then edit both file.Here the content of my serviceextinfo.cfg (this will monitor the CPULoad at my windows machine)


The service_description must be the same at your service configuration file.

And for the hostextinfo,cfg

At my system I also edit the config.php, which the configuration file for pnp, I only change the temp directory to /tmp/nagios

$conf['temp'] = /tmp/nagios

Stop the nagios service, and then use the nagios command with -v parameter to check if there are no errors at your configuration file.
If everything is ok then star tthe nagios service then you are done.
To check if your installation success, see at the RRD direcotry whether the rrd and xml files generated on that place.
I got a problem with SELinux feature, that casue the pnp can not read it's RRD dabatabase directory. I still not figure out how to
fix this, so for now I disabled SELinux on my system.

No comments: