Check_SNMP returns integer, XI needs results defined

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Check_SNMP returns integer, XI needs results defined

Post by BanditBBS »

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.
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
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Check_SNMP returns integer, XI needs results defined

Post by nscott »

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>'
Nicholas Scott
Former Nagios employee
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Check_SNMP returns integer, XI needs results defined

Post by BanditBBS »

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
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Check_SNMP returns integer, XI needs results defined

Post by nscott »

Anytime, good luck!
Nicholas Scott
Former Nagios employee
Locked