I'm reading Monitoring Routers and Switches page, in particular "Monitoring SNMP Status Information" section.
In the example above, the "-o ifOperStatus.1" refers to the OID for the operational status of port 1 on the switch. The "-r 1" option tells the check_snmp plugin to return an OK state if "1" is found in the SNMP result (1 indicates an "up" state on the port) and CRITICAL if it isn't found. The "-m RFC1213-MIB" is optional and tells the check_snmp plugin to only load the "RFC1213-MIB" instead of every single MIB that's installed on your system, which can help speed things up.
So, I'm trying out their example:
# /usr/lib/nagios/plugins/check_snmp --hostname=X.X.X.X --community=X --protocol=X --oid=ifOperStatus.5 -r1 -m RFC1213-MIB SNMP OK - 1 | RFC1213-MIB::ifOperStatus.5=1 #
SNMP OK - 1 - interface is "up". I took another of interface down and ran same command for that interface.
# /usr/lib/nagios/plugins/check_snmp --hostname=X.X.X.X --community=X --protocol=X --oid=ifOperStatus.6 -r1 -m RFC1213-MIB SNMP OK - 2 | RFC1213-MIB::ifOperStatus.6=2 # # snmpwalk -Os -cX -vX X ifOperStatus.6 ifOperStatus.6 = INTEGER: down(2) #
SNMP OK - 2 - interface is down
I can't figure out how to get
-r1 to work properly, because even though it sees that interface is down, it passes to Nagios as its OK. Any ideas what am I doing wrong?