I love Nagios.
But I have one more challenge that I can not overcome.
I am using check_snmp to pull GPS location information from a router.
This works fine.
However, If the router can not get a GPS signal I want the service to turn red on my screen.
The problem is that the service stays green because check_snmp is able to successfully pull a "null value" .
After some experimentation I have found a way to turn the service to "Unknown" by doing the following:
check_snmp! C <community> -o <OID> -c :
I leave a blank space after the :
Does anyone know what parameters to pass it to generate a "Critical" or "Warning" ?
Thanks
show warning when SNMP value is empty using check_snmp
Re: show warning when SNMP value is empty using check_snmp
You may be able to do a string/regex match on the output of the check. What does a standard output of the plugin look like?
http://nagiosplugins.org/man/check_snmp
http://nagiosplugins.org/man/check_snmp
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: show warning when SNMP value is empty using check_snmp
Unfortunately, the gps coordinates are constantly changing as the router is a mobile device.
Any other thoughts?
Any other thoughts?
Re: show warning when SNMP value is empty using check_snmp
Well, you could negate and check for "null".
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: show warning when SNMP value is empty using check_snmp
Good idea.
How do you check for "null" in check_snmp?
How do you check for "null" in check_snmp?
Re: show warning when SNMP value is empty using check_snmp
Good question, I would like to assume you could do a string match, but I am having problems setting up an snmp check the returns "null". Do the gps coordinates always return a value with a decimal, comma, colon or other char when working? If so, you string match the char for the check. I will continue attempting to reproduce the "null" issue so I can give the right syntax.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: show warning when SNMP value is empty using check_snmp
Considering you can get it to return unknown with -c : have you tried -c1: to show when less than 1 its critical? There does not seem to be a great way to check for null specifically with either snmp or negate.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.