[monitoring-plugins] check_ifstatus: Fix "-n" and "-u" options

Holger Weiss git at monitoring-plugins.org
Wed Oct 8 22:00:08 CEST 2014


 Module: monitoring-plugins
 Branch: master
 Commit: 83744b24b0eaa2050269d55ec795d5b78da711d9
 Author: Holger Weiss <holger at zedat.fu-berlin.de>
   Date: Wed Oct  8 21:46:09 2014 +0200
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=83744b2

check_ifstatus: Fix "-n" and "-u" options

Ignore interface if it's specified via "-n" OR "-u", not just when it's
specified via "-n" AND "-u".

---

 plugins-scripts/check_ifstatus.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl
index 9aa2515..6ec71d1 100755
--- a/plugins-scripts/check_ifstatus.pl
+++ b/plugins-scripts/check_ifstatus.pl
@@ -176,7 +176,7 @@ foreach $key (keys %ifStatus) {
 	# skip unused interfaces
 	my $ifName = $ifStatus{$key}{$snmpIfDescr};
 
-	if (!defined($ifStatus{$key}{'notInUse'}) || !grep(/^${ifName}/, @unused_ports )) {
+	if (!defined($ifStatus{$key}{'notInUse'}) && !grep(/^${ifName}/, @unused_ports )) {
 		# check only if interface is administratively up
 		if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) {
 			#check only if interface is not excluded



More information about the Commits mailing list