mirror of
https://github.com/ranl/monitor-utils.git
synced 2024-11-22 07:23:42 +01:00
Merge pull request #7 from svamberg/netapp_temperature
Add temperature to performance data string
This commit is contained in:
commit
c909305453
@ -747,6 +747,7 @@ if("$opt{'check_type'}" eq "TEMP") {
|
|||||||
} elsif ( ("$opt{'check_type'}" eq "SHELF") or ("$opt{'check_type'}" eq "SHELFINFO") ) {
|
} elsif ( ("$opt{'check_type'}" eq "SHELF") or ("$opt{'check_type'}" eq "SHELFINFO") ) {
|
||||||
my @errs;
|
my @errs;
|
||||||
my $r_shelf = $snmp_session->get_table($snmpEnclTableIndex);
|
my $r_shelf = $snmp_session->get_table($snmpEnclTableIndex);
|
||||||
|
my $perf_temp = "";
|
||||||
foreach my $key ( sort keys %$r_shelf) {
|
foreach my $key ( sort keys %$r_shelf) {
|
||||||
my @tmp_arr = split(/\./, $key);
|
my @tmp_arr = split(/\./, $key);
|
||||||
my $oid = pop(@tmp_arr);
|
my $oid = pop(@tmp_arr);
|
||||||
@ -791,8 +792,13 @@ if("$opt{'check_type'}" eq "TEMP") {
|
|||||||
|
|
||||||
|
|
||||||
foreach my $subkey ( keys %shelf) {
|
foreach my $subkey ( keys %shelf) {
|
||||||
if ( $shelf{$subkey} ne "" )
|
if ( $shelf{$subkey} ne "" ) {
|
||||||
{ print "$subkey->$shelf{$subkey} "; }
|
print "$subkey->$shelf{$subkey} ";
|
||||||
|
if ( "$subkey" eq "CurrentTemp" ) {
|
||||||
|
$shelf{$subkey} =~ m/^([0-9]+)C.*$/;
|
||||||
|
$perf_temp = "$perf_temp, temp_$shelf{'ShelfNumber'}=$1";
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{ print "$subkey->"; print "None "; }
|
{ print "$subkey->"; print "None "; }
|
||||||
|
|
||||||
@ -813,7 +819,7 @@ if("$opt{'check_type'}" eq "TEMP") {
|
|||||||
$stat = $ERRORS{'OK'};
|
$stat = $ERRORS{'OK'};
|
||||||
$msg = "OK: $opt{'check_type'} ok";
|
$msg = "OK: $opt{'check_type'} ok";
|
||||||
if ("$opt{'check_type'}" eq "SHELFINFO")
|
if ("$opt{'check_type'}" eq "SHELFINFO")
|
||||||
{ $perf = "shelfinfo=0"; }
|
{ $perf = "shelfinfo=0$perf_temp"; }
|
||||||
else
|
else
|
||||||
{ $perf = "shelf=0"; }
|
{ $perf = "shelf=0"; }
|
||||||
} else {
|
} else {
|
||||||
@ -823,7 +829,7 @@ if("$opt{'check_type'}" eq "TEMP") {
|
|||||||
$msg = "$msg $_";
|
$msg = "$msg $_";
|
||||||
}
|
}
|
||||||
if ("$opt{'check_type'}" eq "SHELFINFO")
|
if ("$opt{'check_type'}" eq "SHELFINFO")
|
||||||
{ $perf = "shelfinfo=1"; }
|
{ $perf = "shelfinfo=1$perf_temp"; }
|
||||||
else
|
else
|
||||||
{ $perf = "shelf=1"; }
|
{ $perf = "shelf=1"; }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user