nagios check_snmp problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
crikelvin
Posts: 1
Joined: Sun Sep 17, 2017 10:39 pm

nagios check_snmp problem

Post by crikelvin »

Hi all, I am trying to use nagios check_snmp plugin to monitor the port status of my cisco 6504E switch.
I successfully use the check_snmp to get the port status but nagios didn't change the status to critical even snmp return the status is down.
It still show "SNMP OK". I already updated check_snmp version to 2.2 but is still abnormal function. It seem the -r 1 is not working.

Below is the command i using:

[root@monitor monitoring-plugins-2.2]# /usr/local/nagios/libexec/check_snmp -H XX.XX.XX.XX -C ABC -o IF-MIB::ifName.1 -o ifOperStatus.1 -r 0
SNMP CRITICAL - *Gi1/2/1* down(2) |
[root@monitor monitoring-plugins-2.2]# /usr/local/nagios/libexec/check_snmp -H XX.XX.XX.XX -C ABC -o IF-MIB::ifName.1 -o ifOperStatus.1 -r 1
SNMP OK - Gi1/2/1 down(2) |
[root@monitor monitoring-plugins-2.2]# /usr/local/nagios/libexec/check_snmp -H XX.XX.XX.XX -C ABC -o IF-MIB::ifName.1 -o ifOperStatus.1 -r 2
SNMP OK - Gi1/2/1 down(2) |

My Nagios version is 4.1.1. Is there any way to make "-r 1" function normally? Thank you.
DiegoAnjos
Posts: 49
Joined: Thu Feb 14, 2013 9:32 am

Re: nagios check_snmp problem

Post by DiegoAnjos »

I use the check below and it warns me whenever the port is down:

Code: Select all

define service{
	use			                generic-service
	host_name		        SW01
	service_description	        PORT 47 UPLINK 
	check_command		check_snmp! -C community -o ifOperStatus.47 -m IF-MIB -l OperStatus -s 'up(1)'
	}
The -s 'up(1)' is the expected string. Anything different from this and Nagios will understand that this is not OK.
kyang

Re: nagios check_snmp problem

Post by kyang »

Thanks @DiegoAnjos,

Here's something I found on another forum post that may be related?
https://support.nagios.com/forum/viewto ... =7&t=39059

Code: Select all

./check_snmp -H 10.xxx.xx.xx 1 -o xx -C public -r 1 -l "FW-01-eth1 interface status"
Tell the check what you expect for an output

Code: Select all

-r, --ereg=
      REGEX Return OK state (for that OID) if extended regular expression REGEX matches
so the -r 1 is for status 1 (up) if the status returns something else then 1 it fails

Let us know if DiegoAnjo's post or mine help
Locked