Translations of this page:

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:

  1. check_generic saves the first value in a unique file together with the current timestamp
  2. There is nothing to report, so check_generic returns UNKNOWN
  3. 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.
  4. The new value is saved in the unique file.
  5. … goto 3 and redo …

2. Performance data

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

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
projects/check_generic/advanced.txt · Last modified: 2007/10/15 09:22 by flackem = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0