Problem with -r option in check_snmp

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Problem with -r option in check_snmp

Postby semalan » Wed Mar 16, 2011 3:22 am

Hi to all!

I have the following problem.
I need to check BGP service by check_snmp (I know about check_bgpstate, it doesn't meet my demands).
So, if request "check_snmp -H <some IP> -o 1.3.6.1.2.1.15.3.1.5.<some IP> -C <host's community>" returns 'OK - = IP address: 0.0.0.0' then service is down.
Therefore i can't use syntax like "check_snmp -H <some IP> -o 1.3.6.1.2.1.15.3.1.5.<some IP> -C <host's community> -s <expected string>" because if s="0.0.0.0" then it's not OK!
I tried to use something like "check_snmp -H <some IP> -o 1.3.6.1.2.1.15.3.1.5.<some IP> -C <host's community> -r '(?!0\.0\.0\.0)' " but get regexp compilation error :(

So, the question is: how to make check_snmp return OK if response NOT EQUAL 0.0.0.0 ? Maybe I need some sophisticated regexp?

Thanx
semalan
 
Posts: 1
Joined: Wed Mar 16, 2011 3:02 am

Re: Problem with -r option in check_snmp

Postby Lahn » Wed Mar 16, 2011 11:17 am

First of all, there's a simple parameter you can give check_snmp so it returns critical if regex matches: --invert-search
I'm not too good with regular expressions so can't tell you why you get a compilation error.

Furthermore, if you use the newest version of the nagios plugins (1.3.15), be aware that the return value is bugged and always return OK
http://sourceforge.net/tracker/index.ph ... tid=397597
Lahn
 
Posts: 2
Joined: Tue Mar 15, 2011 7:34 pm


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 26 guests