Networking

Check interfaces for errors

Description:

Nagios plugin to check all or some network interfaces on a network device for errors.

Current Version

Last Release Date

June 5, 2009

Compatible With


Project Files
Project Notes
This plugin checks all or specified interfaces on a device for errors. It uses SNMP to read the IfInErrors and IfOutErrors counters, so it catches all errors that increment these counters. The output is the rotal number of errors and the the interfaces with errors. To install, create a directory /var/cache/nagios/iferrors/ and give the nagios user all rights on this directory. Known bug: You cannot use multiple instances of this check on the same device.
Reviews (4) Add a Review
newer version
by mnalis, January 31, 2015

this seems to be updated by http://exchange.nagios.org/directory/Plugins/System-Metrics/Networking/Check-Cisco-Interfaces-for-errors-and-drops/details



No SNMPv3 support
by dataviruset, February 28, 2014

Good, good, but I had to modify it to get SNMPv3 access. These are the modified code parts: usage_and_exit() unless GetOptions("h|help" => $opt_h, "C|community=s" => $snmp_community, "w|warning=s" => $warn_usage, "c|critical=s" => $crit_usage, "p|port=i" => $port, "i|interface=s" => $iface_descr, "H|hostname=s" => $host_address, "a|authproto=s" => $snmp_authproto, "u|username=s" => $snmp_username, "x|password=s" => $snmp_password, "X|privpasswd=s" => $snmp_privpasswd, "P|privproto=s" => $snmp_privproto, "v|version=s" => $snmp_version ); elsif ( $snmp_version == /3/ ) { ($session, $error) = Net::SNMP->session( -hostname => $host_address, -version => $snmp_version, -username => $snmp_username, -port => $port, -authpassword => $snmp_password, -authprotocol => $snmp_authproto, -privpassword => $snmp_privpasswd, -privprotocol => $snmp_privproto, ); if ( !defined($session) ) { print("UNKNOWN: $error"); exit STATUS_UNKNOWN; } } print "Check_all_interfaces.pl version " . VERSION . "n(c) 2008 M. Lievaartn"; print "Usage: $0 -H host [ options ]nn"; print "Options:n"; print " -H --host STRING or IPADDRESSn"; print " Check interface on the indicated host.n"; print " -C --community STRING n"; print " SNMP Community.n"; print " -i --interface STRINGn"; print " Regexp matching interfaces to examine, f.i. '^FastEthernet' or '^(Eth|Dot.*0$)'.n"; print " -w --warning INTEGERn"; print " number of necessary errors since last check to result in warning status (default: 1)n"; print " -c --critical INTEGERn"; print " number of necessary errors since last check to result in critical status (default: 5)n"; print " -v --version [1, 2 or 3]n"; print " SNMP version to use, use '2' for version 2c. (default: version 2c).n"; print " -a --authproto STRINGn"; print " SNMP auth protocol to use for SNMPv3. (default: md5).n"; print " -P --privproto STRINGn"; print " SNMP private protocol to use for SNMPv3. (default: des).n"; print " -X --privpasswd STRINGn"; print " SNMP private password to use for SNMPv3.n"; print " -u --username STRINGn"; print " SNMP username to use for SNMPv3.n"; print " -x --password STRINGn"; print " SNMP password to use for SNMPv3.n";



Good, but has errors
by feitingen, October 31, 2013

Some interfaces have a description but no errors counted. To get rid of errors, add this to line 164: next unless defined $in_errors;



Good check, But:
by kotterbein, January 31, 2013

Having some output issues: Use of uninitialized value in concatenation (.) or string at ./check_all_interfaces.pl line 196. Use of uninitialized value in concatenation (.) or string at ./check_all_interfaces.pl line 196. Use of uninitialized value in concatenation (.) or string at ./check_all_interfaces.pl line 196. Use of uninitialized value in concatenation (.) or string at ./check_all_interfaces.pl line 196. Use of uninitialized value in numeric gt (>) at ./check_all_interfaces.pl line 199. Use of uninitialized value in numeric gt (>) at ./check_all_interfaces.pl line 199. Use of uninitialized value in numeric gt (>) at ./check_all_interfaces.pl line 200. Use of uninitialized value in numeric gt (>) at ./check_all_interfaces.pl line 200. Use of uninitialized value in numeric gt (>) at ./check_all_interfaces.pl line 201. Use of uninitialized value in numeric gt (>) at ./check_all_interfaces.pl line 201. Use of uninitialized value in numeric gt (>) at ./check_all_interfaces.pl line 202. Use of uninitialized value in numeric gt (>) at ./check_all_interfaces.pl line 202. Use of uninitialized value in subtraction (-) at ./check_all_interfaces.pl line 213. Use of uninitialized value in subtraction (-) at ./check_all_interfaces.pl line 213. Use of uninitialized value in subtraction (-) at ./check_all_interfaces.pl line 215. Use of uninitialized value in subtraction (-) at ./check_all_interfaces.pl line 215. Use of uninitialized value in subtraction (-) at ./check_all_interfaces.pl line 217. Use of uninitialized value in subtraction (-) at ./check_all_interfaces.pl line 217. Use of uninitialized value in subtraction (-) at ./check_all_interfaces.pl line 219. Use of uninitialized value in subtraction (-) at ./check_all_interfaces.pl line 219. OK: Total in errors: 0, Total out errors: 0, Total in discards: 0, Total out discards: 0 | inErr=0, outErr=0, inDis=0, outDis=0 I think this may be due to the interfce descriptions carrying and - in them. any way to get around this?



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
3.5 (4)
Favorites
0
Views
134,010