Problem with -r option in check_snmp
Posted: 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
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