Преглед на файлове

Some objects returned from an interface don't have a defined entry for our snmpLocIfDescr key - don't operate on the value unless it exists

madlohe преди 4 години
родител
ревизия
de7ebf90c3
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      plugins-scripts/check_ifstatus.pl

+ 1 - 1
plugins-scripts/check_ifstatus.pl

@@ -187,7 +187,7 @@ foreach $key (keys %ifStatus) {
 				#counter for matching descriptions
 				my $match_descr = 0;
 				foreach my $description (@exclude_descriptions) {
-					if ($ifStatus{$key}{$snmpLocIfDescr} =~ /^$description/) { $match_descr = 1; }
+					if (defined ($ifStatus{$key}{$snmpLocIfDescr}) && $ifStatus{$key}{$snmpLocIfDescr} =~ /^$description/) { $match_descr = 1; }
 				}
 				if ($match_descr == 0) {
 					# check only if interface type is not listed in %excluded