Fix non-existent items in SNMP v2c for SHELF test

Non existent items returns SNMPv1 and SNMPv2c different.
In SNMPv1 return as empty string but SNMPv2c return string
with 'noSuchInstance'.
This commit is contained in:
Michal Svamberg 2015-05-31 02:01:25 +02:00
parent c9e7c6839c
commit 55ccc3a081
1 changed files with 2 additions and 3 deletions

View File

@ -878,8 +878,7 @@ if("$opt{'check_type'}" eq "TEMP") {
foreach my $subkey ( keys %shelf) {
if ( $shelf{$subkey} ne "" ) {
print "$subkey->$shelf{$subkey} ";
if ( ($shelf{$subkey} ne "") and ($shelf{$subkey} ne "noSuchInstance") ) {
if ( "$subkey" eq "CurrentTemp" ) {
$shelf{$subkey} =~ m/^([0-9]+)C.*$/;
$perf_temp = "$perf_temp, temp_$shelf{'ShelfNumber'}=$1";
@ -889,7 +888,7 @@ if("$opt{'check_type'}" eq "TEMP") {
{ print "$subkey->"; print "None "; }
if ("$opt{'check_type'}" eq "SHELF") {
if($shelf{$subkey}) { push(@shelf_err,"$addr $subkey,") }
if(($shelf{$subkey} ne "") and ($shelf{$subkey} ne "noSuchInstance")) { push(@shelf_err,"$addr $subkey,") }
}
}