Sometimes data comes as an absolute value (e.g. counter) and you want to know for example how many packets have been transported through your network interface. Then you have to save the first value, take a second value after some time and calculate the difference related to the elapsed time. The formula for this is
Packets/s = (Newval - Oldval) / ElapsedSeconds
check_generic supports this delta data also, you only have to provide the
-y/–type delta option.
The procedure works like this:
One more thing: performance data. Yes, check_generic can provide performance data. Just add the
-p/–performance <tag> option.
The command line from Step by step now looks like this
$ ./check_generic -n nagios_service_latency -e "/usr/local/nagios/bin/nagiostats -m -d AVGACTSVCLAT" -c ">60000" -w ">500" -p "service_latency" nagios_service_latency OK - result:489 match:none |service_latency=489
Sometimes you want to specify something special: Maybe the normal state should be OK, and if it does not match it should report UNKNOWN. But check_generic does not know that the opposite of OK is UNKNOWN.
So if you have something different from the pair CRITICAL/WARNING-OK, you should explicitly say check_generic what it should do if the expression is not matched: -f/–false. So a possible commandline can look like this:
$ ./check_generic -n strange_service -e "command" -o ">2" -f unknown