check_snmp for multiple MIB arguments

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
Tal
Posts: 12
Joined: Wed Jun 06, 2012 1:40 pm

check_snmp for multiple MIB arguments

Post by Tal »

I am looking for help on using check_snmp with multiple MIB arguments....

for instance....would the syntax look like....

command_line $USER1$/check_snmp! -v 2c -H $HOSTADDRESS$ -C xxxx -o IF-MIB::(ifDesc.(port) = STRING | IF-MIB::ifName.(port) = STRING | IF-MIB ....

basically I'm looking to tie a bunch of IF-MIB statements into my check_snmp string and I'm not sure if what I want to do is possible or not or how I would go about creating the string


Here are a list of IF-MIB statements I'm hoping to use....

SNMPv2-MIB::sysName.0 = STRING #FDQN device name
IF-MIB::ifDescr.(port) = STRING #switchport name (label FastEthernet1/0/1)
IF-MIB::ifName.(port) = STRING #switchport name (label Fa1/0/1)
IF-MIB::ifOperStatus.(port) = INTEGER #port status (up or down)
IF-MIB::ifAdminStatus.105(port) = INTEGER #port admin status (up or down)
IF-MIB::ifPhysAddress.(port) = STRING #mac address
IF-MIB::ifLinkUpDownTrapEnable.(port) = INTEGER #is snmp trap enabled
IF-MIB::ifHighSpeed.(port) = Guage32 #port connectivity speed
IF-MIB::ifPromiscuousMode. (port) = INTEGER #promiscuous mode
IF-MIB::ifLastChange.(port) = TimeTicks #time since last port status change
IF-MIB::ifName.1 = STRING #vlan id (vl1)
IF-MIB::ifDescr.1 = STRING #vlan id (vlan1)
IF-MIB::ifAdminStatus.1 = INTEGER #vlan status (up or down)
IF-MIB::ifPhysAddress.1 = STRING #vlan mac address
IF-MIB::ifInUcastPkts.(port) = Counter32 #unicast packets (port) IfOutUcastPkts (unicast going out)
IF-MIB::ifInMcastPkts.(port) = Counter32 #multicast packets (port) IfOutMcastPkts (multicast packets out)
IF-MIB::IfInDiscards.(port) = Counter32 # ifOut....
IF-MIB::ifInErrors.(port) = Counter32 # IfOut...
IF-MIB::ifInUnknownProtos.(port) = Counter32 # ifOut....
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: check_snmp for multiple MIB arguments

Post by jsmurphy »

The syntax would be:

command_line $USER1$/check_snmp! -v 2c -H $HOSTADDRESS$ -C xxxx -o IF-MIB::ifDesc.(port), IF-MIB::ifName.(port), IF-MIB::ifOperStatus.(port) -w oid1warn,oid2warn,oid3warn -c oid1crit,oid2crit,oid3crit

However you can only have a max of 8 OID's per check_snmp query. Have a read of the manpage for check_snmp: http://nagiosplugins.org/man/check_snmp
Locked