======verify_pnp_config======
Since PNP 0.4.12 the contrib directory contains a perl script (verify_pnp_config) which enables you to check the configuration settings as well as performance data of hosts or services. It can be used prior and during runtime of PNP.
*** Note ***: The information applies to verify_pnp_config v0.1.17 which is available in the current developer version (starting with SVN Rev. 644) downloadable via http://www.pnp4nagios.org/pnp/dwnld.
Older versions may have fewer options so in the descriptions of the various options you will find hints to the PNP versions.\\
*** Note ***: The "long" options always start with two "-" which isn't clearly visible in the text.
PNP-Version 0.4.12 contains verify_pnp_config 0.1.2\\
PNP-Version 0.4.13 contains verify_pnp_config 0.1.9\\
PNP-Version 0.4.14 contains verify_pnp_config 0.1.12\\ \\
*** Attention *** 0.1.9 contains a bug which leads to an error message while checking the template definition in bulk and NPCD mode. The last parameter will be flagged as erroneous even if it is correct. Please add the statement ''$val .= "\\t";'' prior to line 632 so that the lines look like this:629 if ($val !~ /([A-Z]+?::[A-Z\$]+?.?)+/) {
630 info ("invTemplate");
631 }
632 $val .= "\\t";
633 while ($val =~ s/([A-Z]+?)::(.+?)([^A-Z\$].)//) {
*** Attention *** 0.1.12 contains bugs when checking performance data. If you need this feature then please use the current SVN version (starting with Rev. 633).\\
0.1.12 contains another bug which leads to an error message while checking the template definition in bulk and NPCD mode. SERVICEOUTPUT and HOSTOUTPUT resp. are reported missing but they don't belong to the template definition of PNP. They are in the default config file of Nagios instead (fixed in Rev. 639).\\
\\
Checking the configuration can be done executing./verify_pnp_config -m replacing by default, bulk or NPCD.
Specifying the option ''-h'' or ''–-help'' respectively shows the following lines:
-h, --help print these lines
-b, --basedir=s Nagios Base directory (default: /usr/local/nagios)
-B, --binary=s Nagios binary (default: nagios)
-c, --config=s Nagios main config file (default: /usr/local/nagios/etc/nagios.cfg)
-m, --mode=s PNP mode ("default", "bulk", "NPCD")
-l, --logfile=s check configure log file
-N, --npcdcfg=s PNP config file for NPCD mode (default: /usr/local/nagios/etc/pnp/npcd.cfg)
-P, --ppcfg=s process_perfdata config file (default: /usr/local/nagios/etc/pnp/process_perfdata.cfg)
-p, --precheck use config files instead of objects cache
-r, --rrdtool=s specify the location of the RRDtool binary
-R, --RRDpath=s specify the perfdata directory (default: /usr/local/nagios/share/perfdata) or "no" for no check
-U, --resource=s location of the resource config file (default: /usr/local/nagios/etc/resource.cfg)
-M, --monitor=s specify the monitoring product (default: nagios)
-L, --layout=s specify a layout (Nagios2, Nagios3, SuSE, Fedora)
-T, --template=s specify the path to the templates directory (default /usr/local/nagios/share/pnp/templates.dist)
-u, --user=s user of the perfdata directory
-g, --group=s group of the perfdata directory
-q, --quiet quiet mode, non-zero return code will indicate errors
-o, --object=s Nagios object (host name, service description)
-n, --native show messages in native language (so far "es" or "de")
-e, --english show english messages/links
-d, --debug some debugging output
The Nagios program and access to the main configuration file are always necessary. If you have non-standard paths because you installed a Nagios package you can try to use one of the predefined layouts. "suse" and "fedora" should work on the appropriate distributions while "nagios2" and
"nagios3" should work on other depending on the Nagios version you installed.
If none of these methods work you can use three options (-b, -B and -c) to specify the nagios base directory, the name of the binary and the place of the main config file. If the program name starts with a "/" then this value is taken as an absolute path which isn't modified anymore. If it doesn't start with a "/" then the path is composed of the basedir, the string "bin" and the binary. Using -U you can specify the location on the resource config file.
(-b / -c starting with PNP 0.4.12; -B starting with Rev. 612; -U starting with Rev. 635)
Without specifying any options the help page will be shown so you'll have to specify either the mode or an object.
Using the option ''-m'' (''--mode'') you specify one of the PNP modes whose settings will be checked. The option ''-l '' (''--logfile='') allows to check the config during installation of PNP. You have to execute ''./configure'' (with additional options if necessary) first which creates the file ''config.log''. This name has to be passed as parameter value. The script checks if software requirements are met and if several settings have been specified correctly. That includes a call of the RRDtool binary so you may use the option ''-r '' (''--rrdtool '') if the binary can not be found at ''/usr/bin/rrdtool''.
(-m / -l starting with PNP 0.4.12, -r starting with PNP 0.4.13)
The script checks if owner and group of the directories and files below the perfdata folder correspond to the values given in nagios.cfg. Additionally the xml files are checked for non-zero return codes of RRDtool. Using the option ''-R'' (''--RRDpath'') you can specify the directory where the RRD files are located if its place is non-standard. If you don't wish these checks to be performed please specify "no" as directory name. Using the options -u (--user) and -g (--group) you can specify user and/or group of the perfdata directory if they don't match the values of the nagios user.
(-R starting with PNP 0.4.14 / SVN Rev. 598; -u / -g starting with Rev. 635).
After the installation the changes in ''nagios.cfg'' can be checked using the option ''-p'' (''--precheck'') before restarting nagios. This way you can correct any errors without restarting every time.
Together with the option ''-o