User Tools

Site Tools


pnp-0.4:tpl_custom

Custom Templates

As already described under “What are templates ?” the appearance of graphs depends on the check command used.

There are situations where this behaviour must be overruled. This has to be done when universal commands have been defined.

CUSTOM_TEMPLATE

Example:

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

This would lead to a call of the check_nrpe.php template even when the monitored host would use a completely different plugin which is called via NRPE.

PNP, especially process_perfdata.pl, will search for a config file (<check_command>.cfg) in the etc/pnp/check_commands directory and read its contents (if available).

As our example command is called check_nrpe it will be searched for etc/pnp/check_commands/check_nrpe.cfg.

During installation a sample config file with the extension .cfg-sample is copied to etc/pnp/check_commands.

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 (starting with PNP-0.4.11)

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 (starting with PNP-0.4.13)

USE_MAX_ON_CREATE = 1

Account for the minimum value taken from the performance data (starting with PNP-0.4.13)

USE_MIN_ON_CREATE = 1
pnp-0.4/tpl_custom.txt · Last modified: 2022/01/21 14:37 by 127.0.0.1