I am using check_snmp to check the status of some UPS's. I get results back of an integer of 1,2,3,4 or 5. No matter what returns Nagios is saying the service is OK. I want to tell Nagios that:
1=unknown
2=Ok
3=Critical
any other=warning
It has been way to long since I did this last, I can not remember where/how to do this. Can anyone give me a quick hint.
Check_SNMP returns integer, XI needs results defined
Check_SNMP returns integer, XI needs results defined
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Check_SNMP returns integer, XI needs results defined
You would actually have to edit the plugins to achieve some of these aims, and since the check_snmp plugin is compiled C, you'll have to grab the source code, however, you can achieve most of these aims by using the command flags. (Reference here: http://nagiosplugins.org/man/check_snmp )
The Unknowns statuses are hard coded into the script, so I won't be able to help you there. Your situation sounds pretty specific, and this plugin doesn't offer -w and -c @ ranging support so you'll have to find the string that the SNMP is returning, which can't afford you a Warning status. Give this a try:
./check_snmp -H <host IP> -C <community string> -o <OID> -s '<string SNMP plugin will return to signify OK status>'
The Unknowns statuses are hard coded into the script, so I won't be able to help you there. Your situation sounds pretty specific, and this plugin doesn't offer -w and -c @ ranging support so you'll have to find the string that the SNMP is returning, which can't afford you a Warning status. Give this a try:
./check_snmp -H <host IP> -C <community string> -o <OID> -s '<string SNMP plugin will return to signify OK status>'
Nicholas Scott
Former Nagios employee
Former Nagios employee
Re: Check_SNMP returns integer, XI needs results defined
Good enough for me, adding the -s '2' makes anything but 2 come up as critical, that'll work for my situation, thanks for the help.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Check_SNMP returns integer, XI needs results defined
Anytime, good luck!
Nicholas Scott
Former Nagios employee
Former Nagios employee