Page 1 of 1

specify critical range for check_snmp script

Posted: Tue Feb 19, 2013 12:14 pm
by tom_wong
Hi, we are really confused to to implement a range for critical condition. All we want is only critical if the received value is 2.

Couldn't get it done using the Nagios document.

Range definition Generate an alert if x...
10 < 0 or > 10, (outside the range of {0 .. 10})
10: < 10, (outside {10 .. ∞})
~:10 > 10, (outside the range of {-∞ .. 10})
10:20 < 10 or > 20, (outside the range of {10 .. 20})
@10:20 ≥ 10 and ≤ 20, (inside the range of {10 .. 20})
20:10 Inclusive of 10 to 20



Thanks
Tom

Re: specify critical range for check_snmp script

Posted: Tue Feb 19, 2013 12:54 pm
by sreinhardt
Does setting just -c 2 not work for you? It would seem that the check command accepts this just fine without -w.

Re: specify critical range for check_snmp script

Posted: Wed Feb 20, 2013 5:36 am
by tom_wong
Hi, no -c 2 still returns OK if the value is 2.

Tom

Re: specify critical range for check_snmp script

Posted: Wed Feb 20, 2013 12:21 pm
by sreinhardt
My mistake Tom, -c is for specifying what will not result in a critical. How about "-c :1 or 3:" meaning 1 or less, or, 3 or higher are not critical. This should just leave 2 as a critical causing return. You might have to wrap that in double or single quotes such as -c ':1 or 3:' or -c ":1 or 3:".

Re: specify critical range for check_snmp script

Posted: Wed Feb 27, 2013 11:10 am
by tom_wong
Hi, the -c :1 or 3: works.

Thanks
Tom

Re: specify critical range for check_snmp script

Posted: Wed Feb 27, 2013 11:29 am
by sreinhardt
you are most welcome, thank you for letting us know!