mirror of
https://github.com/ranl/monitor-utils.git
synced 2026-02-06 15:15:19 +01:00
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:
@@ -878,8 +878,7 @@ if("$opt{'check_type'}" eq "TEMP") {
|
|||||||
|
|
||||||
|
|
||||||
foreach my $subkey ( keys %shelf) {
|
foreach my $subkey ( keys %shelf) {
|
||||||
if ( $shelf{$subkey} ne "" ) {
|
if ( ($shelf{$subkey} ne "") and ($shelf{$subkey} ne "noSuchInstance") ) {
|
||||||
print "$subkey->$shelf{$subkey} ";
|
|
||||||
if ( "$subkey" eq "CurrentTemp" ) {
|
if ( "$subkey" eq "CurrentTemp" ) {
|
||||||
$shelf{$subkey} =~ m/^([0-9]+)C.*$/;
|
$shelf{$subkey} =~ m/^([0-9]+)C.*$/;
|
||||||
$perf_temp = "$perf_temp, temp_$shelf{'ShelfNumber'}=$1";
|
$perf_temp = "$perf_temp, temp_$shelf{'ShelfNumber'}=$1";
|
||||||
@@ -889,7 +888,7 @@ if("$opt{'check_type'}" eq "TEMP") {
|
|||||||
{ print "$subkey->"; print "None "; }
|
{ print "$subkey->"; print "None "; }
|
||||||
|
|
||||||
if ("$opt{'check_type'}" eq "SHELF") {
|
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,") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user