Check multiple ports of a switch with snmp

Frank Bulk frnkblk at iname.com
Sun Mar 11 22:20:18 CET 2012


I would suggest looking at this script:
http://nagios.manubulon.com/snmp_int.html

Frank

-----Original Message-----
From: Mester [mailto:mester at freemail.hu] 
Sent: Saturday, March 03, 2012 12:24 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Check multiple ports of a switch with snmp

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6517 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120311/239488c4/attachment.bin>
-------------- next part --------------
------------------------------------------------------------------------------
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/
-------------- next part --------------
_______________________________________________
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