[afnog] OID value

Hugo Lombard hal at elizium.za.net
Wed Nov 13 13:58:18 UTC 2013


On Wed, Nov 13, 2013 at 02:14:51PM +0100, Anibe Onuche wrote:
> 

[...]

> All I have to do is implement a nagios plugin (check_snmp) to send a
> notification if the integer value = 2
> 

Does check_ifoperstatus (part of nagios-plugins) not do what you need?

Here's an example against a BNT switch, but IF-MIB is standard, it
should work just fine against a Cisco:

- Using ifIndex:

  $ /usr/lib64/nagios/plugins/check_ifoperstatus -H bntsw1 -k 145
  OK: Interface EXT1 (index 145) is up.
  $ 

- Using ifDescr:

  $ /usr/lib64/nagios/plugins/check_ifoperstatus -H bntsw1 -d EXT1
  OK: Interface EXT1 (index 145) is up.
  $ 

- against a down port:

  $ /usr/lib64/nagios/plugins/check_ifoperstatus -H bntsw1 -d INT6A
  CRITICAL: Interface INT6A (index 139) is down.
  $ 

- ifOperStatus:

  $ snmpget -v 2c -c <somecommunity> bntsw1 ifOperStatus.145
  IF-MIB::ifOperStatus.145 = INTEGER: up(1)
  $ snmpget -v 2c -c <somecommunity> bntsw1 ifOperStatus.139
  IF-MIB::ifOperStatus.139 = INTEGER: down(2)
  $ 

This is on a CentOS 5.x box with nagios-plugins-1.4.15-2.el5.rf from
RPMforge.

-- 
Hugo Lombard
   .___.
   (o,o)
   /)  )
 ---"-"---



More information about the afnog mailing list