Fork me on GitHub
Translations of this page:

Personnaliser les templates

Comme déjà expliqué dans ”Qu'est-ce qu'un template” l'apparence des graphiques dépend de la commande check utilisée.

Il y a des situations où ce comportement doit être changé. Cela doit être fait quand une commande universelle a été définie.

CUSTOM_TEMPLATE

Exemple:

define command {
  command_name check_nrpe
  command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a "$ARG2$"
}

Cela aurait pour effet d'appeler la template check_nrpe.php même si l'host monitoré utilisait un plugin complètement différent appelé via NRPE.

PNP, plus spécifiquement process_perfdata.pl, va rechercher le fichier de config (<check_command>.cfg) dans le dossier etc/check_commands et lit son contenu (s'il est présent).

Comme dans notre exemple, la commande appelée est check_nrpe, il va chercher le fichier etc/check_commands/check_nrpe.cfg.

Pendant l'installation, un exemple de fichier de configuration avec l'extension .cfg-sample est copié dans etc/check_commands.

FIXME Two options can be set in this config file:

# check_command check_nrpe!load!-w 4,4,4 -c 5,5,5
# ________0__________|       |       |
# ________1__________________|       |
# ________2__________________________|
#
CUSTOM_TEMPLATE = 1

CUSTOM_TEMPLATE = 1 assures that only the contents of $ARG1$ will be used as a template name. As $ARG1$ contains “load” in this example the template name would result in “load.php”.

CUSTOM_TEMPLATE = 0,1 results in → “check_nrpe_load.php”

CUSTOM_TEMPLATE = 1,0 results in → “load_check_nrpe.php”

DATATYPE

The option “DATATYPE” controls the datatype which is used during creation of the RRD database. Default is “GAUGE”. For consecutive values the type should be “COUNTER”. Plugin-developers should use the unit “c” for counters but this is not always the case.

To set all datasources to COUNTER

DATATYPE = COUNTER

Setting datasources to different types

DATATYPE = GAUGE,GAUGE,COUNTER,COUNTER

This option has effect only during creation of the RRD database.

More datatypes are explained in the RRDTool documentation found at rrdcreate.

MIN and MAX

In a few situations it might be necessary to limit the values which are valid for RRDTool.

RRD databases can be created with fixed minimum and maximum values. You will find further details at http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html.

Account for the maximum value taken from the performance data

USE_MAX_ON_CREATE = 1

Account for the minimum value taken from the performance data

USE_MIN_ON_CREATE = 1

RRD_STORAGE_TYPE

RRD_STORAGE_TYPE = SINGLE

The option RRD_STORAGE_TYPE defines the kind of data storage.

Possible values are MULTIPLE and SINGLE, respectively.

SINGLE: A RRD database per service

MULTIPLE: One or more RRD databases per service. Each datasource will be stored in a separate RRD database.

ATTENTION: The data will not be migrated automatically! You will find a conversion script here.

RRD_HEARTBEAT

Starting with PNP 0.6.1

RRD_HEARTBEAT = 305

After <RRD_HEARTBEAT> seconds RRDtool expects new data.

More information at http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html

back to contents | PNP in distributed environments

fr/pnp-0.6/tpl_custom.txt · Last modified: 2012/10/06 16:29 by soubelet
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