Change result of SNMP check from OK to critical

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Change result of SNMP check from OK to critical

Post by snapon_admin »

We're trying to setup an SNMP check to check if a specifig BGP neighbor is up or not, so we're using check_snmp against the OID of the specified IP, but when the OID is not found (meaning that the neighbor is down) the result is 'SNMP OK - No Such Instance currently exists at this OID'. We'd like to change that OK to a CRITICAL so we know that the neighbor is down and get an alert on it. Any thoughts on how to acomplish that?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Change result of SNMP check from OK to critical

Post by mbellerue »

Can you give us a screenshot of the check command and the arguments being passed to it?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Change result of SNMP check from OK to critical

Post by snapon_admin »

Screenshot attached. Note: the below screenshot is with the BGP neighbor up which SHOULD result in an ok status. The status changes to say 'No Such Instance currently exists at this OID' when the neighbor is down, but remains with the preface 'SNMP OK -'

command: /usr/local/nagios/libexec/check_snmp -H <IP_ADDRESS> -p 161 -o bgpPeerRemoteAddr.<PEER IP REDACTED> -C <COMMUNITY> -P 2c -m BGP4-MIB
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Change result of SNMP check from OK to critical

Post by mbellerue »

If you added

Code: Select all

--string="IpAddress: <rest of return SNMP message here>"
check_snmp should return critical when that string is not returned.

Otherwise the next best thing would be to write a wrapper script that looks specifically for the "No such instance" string, and returns critical.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked