Performance Data Configuration

Sometimes you might want to tweak performance data and therefore all checks support the perf-config argument to apply tweaks to them.

Syntax

check_plugin perf-config="selector(key:value;...)"

For example:

check_drivesize "perf-config= used %(ignored:true) used(unit:G)"

This will convert used disk space bytes into gigabytes. It also removes the percent performance data from the output completely.

Configuration

The following keys are available:

KeyValueDescription
ignoredtrue or falseRemove the performance value from the list if true.
prefixstringChange the prefix to something else.
suffixstringChange the suffix to something else.
unitstringChange the unit to something else.
magicnumberApply magic factor to performance data.

Selector

The perf-config selector supports wildcards, so something like this will work:

check_plugin perf-config="*(unit:G)"

SNClient will use the options in order and apply the first matching configuration, for example:

check_plugin perf-config="used(ignored:true) *(unit:G)"

will hide used performance data and apply unit G to everything else.

Units

There are several useful conversions available.

Bytes

The base unit B for bytes can be converted into more human-readable units.

A common pattern is *(unit:G) to simply convert all performance data into gigabytes.

check_plugin perf-config="*(unit:G)"

You can choose from these units:

UnitDescription
Kkilobyte
KBkilobyte
KiBkibibyte
Kbkibibyte
KIkibibyte
Mmegabyte
MBmegabyte
MiBmebibyte
Mbmebibyte
MImebibyte
Ggigabyte
GBgigabyte
GiBgibibyte
Gbgibibyte
GIgibibyte
Tterabyte
TBterabyte
TiBtebibyte
Tbtebibyte
TItebibyte
Ppetabyte
PBpetabyte
PiBpebibyte
Pbpebibyte
PIpebibyte
Eexabyte
EBexabyte
EiBexbibyte
Ebexbibyte
EIexbibyte

Seconds / Duration

Durations with the base unit s for seconds can be converted into the following units:

UnitDescription
msmilliseconds
sseconds
mminutes
hhours
ddays
wweeks
yyears

For example, convert the uptime to days:

check_uptime "perf-config=*(unit:d)"

Percent

Performance data with a value, a minimum, and a maximum can be converted to a percentage.

check_plugin perf-config="*(unit:%)"