specify critical range for check_snmp script

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tom_wong
Posts: 37
Joined: Thu Oct 25, 2012 9:13 am

specify critical range for check_snmp script

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: specify critical range for check_snmp script

Post by sreinhardt »

Does setting just -c 2 not work for you? It would seem that the check command accepts this just fine without -w.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tom_wong
Posts: 37
Joined: Thu Oct 25, 2012 9:13 am

Re: specify critical range for check_snmp script

Post by tom_wong »

Hi, no -c 2 still returns OK if the value is 2.

Tom
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: specify critical range for check_snmp script

Post 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:".
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tom_wong
Posts: 37
Joined: Thu Oct 25, 2012 9:13 am

Re: specify critical range for check_snmp script

Post by tom_wong »

Hi, the -c :1 or 3: works.

Thanks
Tom
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: specify critical range for check_snmp script

Post by sreinhardt »

you are most welcome, thank you for letting us know!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked