Page 1 of 1

check_snmp plugin no alarms

PostPosted: Thu Jul 21, 2011 5:00 pm
by dwcallahan
I'm sure this is something simple but I'm having difficulty when getting a status change when giving the check_snmp a -w and -c.

This is a temp probe and i'm wanting to receive a critical when above 80 and a warning in the range of 77-79. Doesn't matter what the temp returns nagios always show the status of OK. Any thoughts??

define host{
use generic-host
host_name sensor1
max_check_attempts 1
alias Temp Sensor 1
check_command check_snmp!-C public -p 161 -o 1.3.6.1.4.1.17095.1.1.0
normal_check_interval 10
retry_check_interval 1
address x.x.x.x
hostgroups sensors
}

define service{
use generic-service
host_name sensor1
service_description Room Temp
check_command check_snmp!-c public -o 1.3.6.1.4.1.17095.3.2.0 -w 77:79 -c :80
}

Re: check_snmp plugin no alarms

PostPosted: Fri Jul 22, 2011 10:51 am
by cconwright
Hi,

This may not solve your problem but if the warning is supposed to be between 77 and 79 then the -w syntax is incorrect, it should be @77:79 rather then just 77:79

I hope this helps,
Clint.

Re: check_snmp plugin no alarms

PostPosted: Fri Jul 22, 2011 4:53 pm
by dwcallahan
Clint,

Thanks for the reply. I believe I tried what you suggested and others as well such as -w 70 -c 80 and still always returns OK.

I see no errors and to be honest don't know exactly where to look for if the check_snmp did have a error. Here is more info after doing a -v on the command if you happen to see anything else wrong.

/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] 10.139.36.156:161 1.3.6.1.4.1.17095.3.2.0
Long output of check plugin (multiline) iso.3.6.1.4.1.17095.3.2.0 = STRING: "77.68"
SNMP OK - "77.68"

Service check command check_snmp! -o 1.3.6.1.4.1.17095.3.2.0 -w@75:79 -c:80 -v

By the way I'm running Nagios 3.2.3 with check_snmp 1.4.15 on a ubuntu 10.04 platform.

Thanks for any help!

Dave

Re: check_snmp plugin no alarms

PostPosted: Thu Jul 28, 2011 4:46 am
by cconwright
Hi Dave,

In your define host you have:

dwcallahan wrote: check_command check_snmp!-C public -p 161 -o 1.3.6.1.4.1.17095.1.1.0


but in the define service you have:

dwcallahan wrote: check_command check_snmp!-c public -o 1.3.6.1.4.1.17095.3.2.0 -w 77:79 -c :80


Does the C/c make a difference?

Also what is your command?

I ask because I recently did something similar and in the command.cfg the syntax was "-C '$ARG1$' -o '$ARG2$' -w '$ARG3$':'$ARG4$' -c '$ARG5:'$ARG6$'" but in my define service I was also adding all of that in formation in the format of "check_snmp!-C public -o 1.3.6.1.4.1.19011.1.3.3.1.2.3.2.1 -w @200:250 -c @150:300", this constantly returned OK.

When the define service should of only been "check_snmp!public!1.3.6.1.4.1.19011.1.3.3.1.2.3.2.1!@200!250!@150!300" because I already defined the command and just needed to add in the arguments (the words between the !'s to the $ARG#$'s).

I hope this helps!
Clint.

Re: check_snmp plugin no alarms

PostPosted: Fri Jul 29, 2011 12:44 pm
by dwcallahan
Clint,

Thanks again for some help!

I believe the C/c makes no difference in my case but your right it should b CAPS according to the check_snmp MAN page. I changed it and still no status change. The command definition is the default which has only 1 argument. I believe how I had it with !-c public -o 1.3.6.1.4.1.17095.3.2.0 -w @77:79 -c :80 should work but what do I know. Here is the command...

# 'check_snmp' command definition
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}

I took what you suggested and created another definition called check_snmp2 and added more $ARG$. Still reported OK.

# 'check_snmp2' command definition
define command{
command_name check_snmp2
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o $ARG2$ -w $ARG3$:$ARG4$ -c $ARG5$:$ARG6$
}


define service{
use generic-service ; Inherit values from a template
host_name sensor1pl
service_description param4 SNMP
check_command check_snmp2!public!1.3.6.1.4.1.17095.3.2.0!@74!80!@81!85
}

I tried it also with ' ' around ARG.. '$ARG1' and still returns OK.

I heated the temp probe up and down way past 81-85 and below 74-80 and the result is always OK..

Re: check_snmp plugin no alarms

PostPosted: Tue Aug 02, 2011 4:55 pm
by nscott
When you run the exact command from the command line, does it work? What is actually returned to the command line when you run your command from the command line?

Re: check_snmp plugin no alarms

PostPosted: Wed Aug 03, 2011 9:40 pm
by dwcallahan
Just tested it via command line and got the same response. Here is the response. Doesn't matter what my -w and -c is I still get SNMP OK

/usr/local/nagios/libexec/check_snmp -H xxx.xxx.xxx.xxx -c public -o 1.3.6.1.4.1.17095.3.2.0 -w 72.00 -c 74.00
SNMP OK - "76.32" |

/usr/local/nagios/libexec/check_snmp -H xxx.xxx.xxx.xxx -c public -o 1.3.6.1.4.1.17095.3.2.0 -w@72:79 -c:80
SNMP OK - "76.32" |