1
0
mirror of https://github.com/ranl/monitor-utils.git synced 2024-10-05 19:23:40 +02: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:
Michal Svamberg 2015-05-31 02:01:25 +02:00
parent c9e7c6839c
commit 55ccc3a081

View File

@ -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,") }
} }
} }