Răsfoiți Sursa

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".
Holger Weiss 11 ani în urmă
părinte
comite
83744b24b0
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      plugins-scripts/check_ifstatus.pl

+ 1 - 1
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