Просмотр исходного кода

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 лет назад
Родитель
Сommit
7cc99d182b
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      plugins-scripts/check_ifstatus.pl

+ 1 - 1
plugins-scripts/check_ifstatus.pl

@@ -171,7 +171,7 @@ foreach $key (keys %ifStatus) {
 	# skip unused interfaces
 	# skip unused interfaces
 	my $ifName = $ifStatus{$key}{$snmpIfDescr};
 	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
 		# check only if interface is administratively up
 		if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) {
 		if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) {
 			#check only if interface is not excluded
 			#check only if interface is not excluded