Pipe your perfdata and out comes your monitoring plugin status and output.
That’s the premise of check_perfdata
. Instead of writing a full-fledged
Nagios-compatible monitoring plugin and implement (and muck up) your own
boundary checking and everything, check_perfdata
accepts as its input your
Nagios-compatible
performance data and will tell you—actually your monitoring system—whether the
current value is OK or not.
Here’s a very simple example:
#!/bin/bash
echo "root_space_used=$(df / --output='pcent' | sed '1d;s/^ *//');75;85" | check_perfdata
That’s it! You just wrote a monitoring plugin that will trigger a WARNING
if
the disk usage passes 75% and a CRITICAL
if it passes 85%.
check_perfdata
can achieve this because of the information that is present in
a simple performance data line. It must be admitted that the format that the
Nagios deviced for the
performance data
in their
plugin
interface is … Well, let’s say that it’s concise. But, it has sufficient
expressivity needed for a lot of use cases.
See the inline help (check_perfdata --help
) for more usage instructions.