Table of Contents
The art of collecting data
PNP supports several modes to process performance data. The modes differ in complexity and the performance to be expected.
The following image shows the connections between Nagios, PNP and RRDtool
Nagios invokes a command for every host and every service whose performance data should be processed. Depending on the mode you choose the data will be passed to process_perfdata.pl or will be written to temporary files and processed at a later time. process_perfdata.pl writes the data to XML files and stores them in RRD files using RRDtool.
Before you choose a mode please read the documentation and decide which way will be the best for installation.
The modes in comparison
The “default mode” is the simplest and easiest to set up. Nagios will call the perl script
process_perfdata.pl for every service to process the data. The default mode will work very good up to about 2.000 services in a 5 minute interval.
In bulk mode nagios writes the necessary data to a temporary file. After expiration of a defined time the file will be processed in one piece and deleted afterwards.
The number of calls of process_perfdata.pl will be reduced by a multiple. Depending on time and the amount of collected data there will be much less system calls. Instead, process_perfdata.pl will run longer.
Note Using this mode you should keep an eye on the runtime of process_perfdata.pl. While it is running to process data nagios will not execute any checks.
snippet of var/perfdata.log:
2007-10-18 12:05:01  71 Lines processed 2007-10-18 12:05:01  .../spool/service-perfdata-1192701894-PID-21138 deleted 2007-10-18 12:05:01  PNP exiting (runtime 0.060969s) ...
71 lines were processed in 0.06 seconds. This will be the data volume of about 2000 services und processing using a 10 second interval. It means we blocked nagios for exactly 0.06 seconds.
Bulk Mode with NPCD
This is the most complicated way but one with the most performance, too.
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.
Which mode you choose will depend on the size of your nagios installation. You will find theses terms throughout the documentation.