Need help with check_snmp with option -s

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
opierp
Posts: 5
Joined: Tue Nov 05, 2013 10:46 pm
Location: San Jose, California

Need help with check_snmp with option -s

Post 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!
opierp
Posts: 5
Joined: Tue Nov 05, 2013 10:46 pm
Location: San Jose, California

Re: Need help with check_snmp with option -s

Post 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!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Need help with check_snmp with option -s

Post 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.
Former Nagios employee
Locked