Page 1 of 1

Need help with check_snmp with option -s

Posted: Tue Dec 03, 2013 4:59 pm
by opierp
Environment: Nagios 3.5.0 on SUSE 12.1

I am trying to use check_snmp as a means to validate the IOS version running on a Cisco switch. I am able to retrieve the IOS version with the following service check.

define service {
use generic-service
hostgroup_name FSS-C3750G-24TS-1U
service_description IOS Version - 1 in Stack
check_command check_snmp!-C s2436608 -o mib-2.47.1.1.1.1.9.1001
}


And, the following command entered in a terminal window returns the correct response.

./check_snmp -H 56.231.135.101 -C s2436608 -o mib-2.47.1.1.1.1.9.1001 -s \"12.2\(35\)SE5\"

SNMP OK - "12.2(35)SE5"


However, the following service check always returns SNMP CRITICAL - *"12.2(35)SE5"*

define service {
use generic-service
hostgroup_name FSS-C3750G-24TS-1U
service_description IOS Check - 1 in stack - 1 in Stack
check_command check_snmp!-C s2436608 -o mib-2.47.1.1.1.1.9.1001 -s \"12.2\(35\)SE5\"
}


Any help will be greatly appreciated!

Re: Need help with check_snmp with option -s

Posted: Wed Dec 04, 2013 10:02 am
by opierp
Well, it appears that the problem is now solved. While searching through the various postings related to check_snmp issues, I ran across an example where the entire string being tested was enclosed with single quotes. I edited the service check to be as:

define service {
use generic-service
hostgroup_name FSS-C3750G-24TS-1U
service_description IOS Check - 1 in stack
check_command check_snmp! -C s2436608 -o MIB-2.47.1.1.1.1.9.1001 -s '\"12.2\(35\)SE5\"'
}

and it works!

Re: Need help with check_snmp with option -s

Posted: Wed Dec 04, 2013 11:11 am
by tmcdonald
Sorry we couldn't get to you; caught us half an hour after we left the office. Good to see you found the solution though! Gonna go ahead and close this up now.