check_snmp always returns OK
check_snmp always returns OK
Hello
We got problems with check_snmp plugins.
I start a query to get the status of a environment and it returns a 1 if its critical and a 2 if its ok.
The command in Nagios looks like:
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.4.1.318.1.1.10.4.3.2.1.5.0.3 -s 2
It should return a critical if the query doesn't result a 2.
But it always returns OK (whetever it returns 1 or 2).
This happens since we upgradet to Nagios Core 3.2.3
before we had something with 2.x.x
can someone please help me in this case?
thanks in advance and kind regards
V3xX
We got problems with check_snmp plugins.
I start a query to get the status of a environment and it returns a 1 if its critical and a 2 if its ok.
The command in Nagios looks like:
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.4.1.318.1.1.10.4.3.2.1.5.0.3 -s 2
It should return a critical if the query doesn't result a 2.
But it always returns OK (whetever it returns 1 or 2).
This happens since we upgradet to Nagios Core 3.2.3
before we had something with 2.x.x
can someone please help me in this case?
thanks in advance and kind regards
V3xX
Last edited by V3xX on Thu Sep 06, 2012 2:36 am, edited 1 time in total.
Re: check_snmp always returns OK
I vaguely remember another post about this... from memory you needed to add quotes around the text to explicitly define it as a string. I also think that -s needs to match the whole return string not just part of it.
So you can try:
If that doesn't work then:
Should work. Using -r specifies that it's a regular expression and will match part of the string.
So you can try:
Code: Select all
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.4.1.318.1.1.10.4.3.2.1.5.0.3 -s '2'Code: Select all
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.4.1.318.1.1.10.4.3.2.1.5.0.3 -r 2Re: check_snmp always returns OK
Thanks for your help.
I tried both of your two examples, both didn't work...
I also tried this
someone has a older Nagios Core (2.x.x), who can get me the check_snmp?
I didn't find it anywhere on internet.
Maybe it helps, if i change this plugin.
Has someone any other ideas?
Thanks and kind regards
V3xX
I tried both of your two examples, both didn't work...
I also tried this
Code: Select all
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.4.1.318.1.1.10.4.3.2.1.5.0.3 -r '2'I didn't find it anywhere on internet.
Maybe it helps, if i change this plugin.
Has someone any other ideas?
Thanks and kind regards
V3xX
Re: check_snmp always returns OK
Check_snmp and all the other plugins are not actually part of Nagios, they are a separate package maintained by different developers. You can find all versions of the nagios-plugins package on the development teams source-forge: http://sourceforge.net/projects/nagiosp ... agiosplug/
It might also be worth asking the question on the dev teams support mailing list, so that if there is a legitimate bug they can fix it: http://nagiosplugins.org/support
It might also be worth asking the question on the dev teams support mailing list, so that if there is a legitimate bug they can fix it: http://nagiosplugins.org/support
Re: check_snmp always returns OK
I don't get it -.-
I've downloaded different versions.
But i can't compile the C-Scripts...
Has someone a compiled one of the check_snmp plugin?
Thanks and kind regards
V3xX
I've downloaded different versions.
But i can't compile the C-Scripts...
Has someone a compiled one of the check_snmp plugin?
Thanks and kind regards
V3xX
Re: check_snmp always returns OK
Any new information?
Can't find something on internet....
kind regards
V3xX
Can't find something on internet....
kind regards
V3xX
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_snmp always returns OK
The SNMP check should still behave the same with the latest version of Nagios Core, what did you get when you tried what Jsmurphy suggested?
Re: check_snmp always returns OK
Hi slansing,
I tried many different ways to get a correct syntax.
Everytime it returned OK if there was a 1 or a 2 as result.
kind regards
V3xX
I tried many different ways to get a correct syntax.
Everytime it returned OK if there was a 1 or a 2 as result.
kind regards
V3xX
Re: check_snmp always returns OK
replace check_snmp with a newer version solved the problem
thanks everyone for your help!
kind regards
V3xX
thanks everyone for your help!
kind regards
V3xX
Re: check_snmp always returns OK
Glad you got it sorted out.