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".
This commit is contained in:
Holger Weiss 2014-10-08 21:46:09 +02:00
parent f40fc650f7
commit 83744b24b0

View file

@ -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