소스 검색

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