From 83744b24b0eaa2050269d55ec795d5b78da711d9 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Wed, 8 Oct 2014 21:46:09 +0200 Subject: 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 9aa25151..6ec71d14 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 -- cgit v1.2.3-74-g34f1