Check multiple ports of a switch with snmp

Mester mester at freemail.hu
Sat Mar 3 19:23:42 CET 2012


Hi All,

I try to check our switch for bad packets. I have succesfully made the 
configuration file, but for some reason it always sais SNMP OK.
This is the command I use for checking:

/usr/local/nagios/libexec/check_snmp -H ip_address -C name -o 
ifInErrors.101 -w 10 -c 100, -o ifInErrors.102 -w 10 -c 100 -o 
ifInErrors.103 -w 10 -c 100, -o ifInErrors.104 -w 10 -c 100

And the result is:

SNMP OK - 0 20 0 0 | RFC1213-MIB::ifInErrors.101=0c 
RFC1213-MIB::ifInErrors.102=20c RFC1213-MIB::ifInErrors.103=0c 
RFC1213-MIB::ifInErrors.104=0c

As you can see I have bad backets on the second port of the switch 
(102), but for some reason the -w and -c part of the command only check 
the first number of the returned string. (In this case this is 0 so it 
thinks everything is ok)

If I put the bad port on the first place it reports warning:

/usr/local/nagios/libexec/check_snmp -H ip_address -C name -o 
ifInErrors.102 -w 10 -c 100, -o ifInErrors.101 -w 10 -c 100 -o 
ifInErrors.103 -w 10 -c 100, -o ifInErrors.104 -w 10 -c 100
SNMP WARNING - *20* 0 0 0 | RFC1213-MIB::ifInErrors.102=20c 
RFC1213-MIB::ifInErrors.101=0c RFC1213-MIB::ifInErrors.103=0c 
RFC1213-MIB::ifInErrors.104=0c

So is there a way to check the whole array of result and no only the 
first number of it?


Attila Mesterhazy

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list