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". 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 -- cgit v0.10-9-g596f