Translations of this page:

This is an old revision of the document!


verify_pnp_config

En cas de problème, il existe le script verify_pnp_config.pl qui se trouve dans le répertoire scripts. Il permet de vérifier la configuration ainsi que les données de performances de vos machines et services. Il peut être lancé avant ou pendant l'utilisation de PNP.

* NB * : ce document s'appuie sur la version v0.1.24 de verify_pnp_config qui est disponible dans la version stable courante disponible par téléchargement à l'emplacement suivant : http://www.pnp4nagios.org/pnp/dwnld. Les anciennes versions pourraient disposer de moins d'options. Vous trouverez des indications sur chacune d'elle en fonction des versions.

* NB * : Dans la version 0.6.4 de PNP, il manque une ligne dans le script qui empêche sont fonctionnement. Il faut ajouter la ligne suivante avant exécution :

     $CPcfg{'$conf[\'max_age\']'} = 'n;^\(?[\d\* ]+\)?$';
     $CPcfg{'$conf[\'temp\']'} = 'd;;';
     $CPcfg{'$conf[\'base_url\']'} = "S;.+;";   # <-- add this line
     $CPcfg{'$conf[\'nagios_base\']'} = "S;.+;";
     $CPcfg{'$conf[\'allowed_for_service_links\']'} = 'S;[\S,]+;';

* NB * : Les options longues commencent toujours avec deux ”-” ce qui n'est pas forcément toujours bien visible dans le texte.

Le test de la configuration peut-être fait en exécutant

./verify_pnp_config.pl -m <mode>

en remplaçant <mode> par sync, bulk or NPCD.

L'utilisation de l'option -h ou –-help renvoi le message suivant :

-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 ("sync", "bulk", "NPCD")
-l, --logfile=s   check configure log file
-D, --pnpdir=s    PNP root dir (PNP version >= 0.6)
-N, --npcdcfg=s   PNP config file for NPCD mode (default: /usr/local/pnp4nagios/etc/pnp/npcd.cfg)
-P, --ppcfg=s     process_perfdata config file (default: /usr/local/pnp4nagios/etc/pnp/process_perfdata.cfg)
-C, --cpcfg=s     PNP config file (config.php)
-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/pnp4nagios/var/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; may be "icinga")
-L, --layout=s    specify a layout (Nagios2, Nagios3, SuSE, Fedora)
-T, --template=s  specify the path to the templates directory (default /usr/local/pnp4nagios/share/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)
-t, --time        show warnings if RRDfiles are too old
-s, --skip        skip check of installed packages
-n, --native      show messages in native language (so far "es" or "de")
-e, --english     show english messages/links
-d, --debug       some debugging output
-I, --info        show information about compile time variable settings

Le programme nagios et l'accès au fichier de configuration sont nécessaire. Si vous n'avez pas de chemin standard pour votre installation du fait de l'utilisation d'un package, vous pouvez utiliser les chemins pré-définis via l'option -L. “suse” et “fedora” marcherons pour ces distributions tandis que “nagios2” et “nagios3” marcherons sur les autres distributions en fonction de votre version de nagios installé. Si rien de tout ceci ne fonctionne, vous pouvez utiliser une de ces 3 options (-b -B ou -c) pour spécifier l'emplacement de base de nagios, le nom de votre binaire ainsi que l'emplacement du fichier de configuration principal. TODO 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.

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 <filename> (--logfile=<filename>) 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 <location> (--rrdtool <location>) if the binary can not be found at /usr/bin/rrdtool.

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.

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 <object> (--object=<object>) you specify a string which is compared to hostnames and/or service descriptions in the objects cache file. The string should be enclosed in quotes to escape blanks and several special characters. If the string matches the name and any performance data will be shown. If no or invalid performance data is present appropriate messages will be given.

Appending a semicolon to the string will result in comparing only hostnames, prepending a semicolon only inspects service descriptions. A semicolon within the string separates hostname and service description.

  • hostname/service description ⇒ string matches hostname or service description
  • hostname; ⇒ string only matches against hostnames
  • ;service description ⇒ string only matches against service descriptions
  • hostname;service description ⇒ hostname and service description have to match

Starting with PNP version 0.6 the directory layout has changed so all files are below a separate directory which can be specified using ”-D” (--pnpdir) if it differs from /usr/local/pnp4nagios. This also affects the options ”-N”, ”-P” and ”-C”, respectively, so you may not have to specify separate values for these options.

When using the NPCD mode you can use -N <config file> (--npcdcfg=<config file>) to specify the location of the config file if its name or location differs from the default (/usr/local/pnp4nagios/etc/npcd.cfg).

Using the option -P <config file> (--ppcfg=<config file>) you can specify the name of the config file for process_perfdata.pl if name or location differs from the default (/usr/local/pnp4nagios/etc/process_perfdata.cfg).

Using the option -M (--monitor) enables you to specify the product which delivers the data to PNP. The default is “nagios” but “icinga” is supported now as well. Additionally you may have to use the options -b, -B and -c as well.

Sometimes changes in template files result in errors which are hard to find in the web GUI. Using the option -T the template files are checked for errors. Specify the path to the templates diretory as a parameter.

Per default the script checks if certain packages are installed. If you experience difficulties with these checks (or when you're sure the required packages are installed) you can use the option -s (--skip) to skip these checks.

Using -n (--native) you can specify “es” or “de” to see spanish or german messages, respectively.

The option -e (--english) enables you to force the use of english messages if the script detects german language settings.

The option -d (--debug) will output additional lines which may help during trouble shooting whereas -q (--quiet) suppresses all output. Errors will result in a non-zero return code.

The option -I (--info) shows the settings of variables like prefix, datadir and other things you might have changed during './configure'. In some cases we need to know these values and using this option is easier than searching different files. The option is available starting with PNP 0.6.7.

Each output line will start with a letter indicating the type of information:

[I] informational message about settings, things to be done, …
[A] actions to be taken
[W] warning message
[E] error message: PNP will not work without resolving the problem(s)
[H] hint: it might be worth reading the appropriate documentation
[D] debugging message, hopefully showing the source of your problem

back to contents | web frontend

fr/pnp-0.6/verify_pnp_config.1289149093.txt.gz · Last modified: 2010/11/07 17:58 by yannig
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0