Change result of SNMP check from OK to critical
- 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
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?
Re: Change result of SNMP check from OK to critical
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
- 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
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
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.
Re: Change result of SNMP check from OK to critical
If you added
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.
Code: Select all
--string="IpAddress: <rest of return SNMP message here>"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!
Be sure to check out our Knowledgebase for helpful articles and solutions!