===== Advanced options ===== === 1. Delta data === 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: - //check_generic// saves the first value in a unique file together with the current timestamp - There is nothing to report, so //check_generic// returns UNKNOWN - Being called the next time //check_generic// notices that there is already an old value, calculates the formula and compares it to the evaluation expressions. - The new value is saved in the unique file. - ... goto 3 and redo ... === 2. Performance data === One more thing: performance data. Yes, //check_generic// can provide performance data. Just add the ''-p/--performance '' option. The command line from [[projects:check_generic::tutorial|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 === 3. False option === 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