1
0
mirror of https://github.com/ranl/monitor-utils.git synced 2024-11-22 07:23:42 +01:00

Adding temperature of shelfs to performance output

I need graphs about temperature of shelfs.
This commit is contained in:
Michal Švamberg 2014-08-18 17:46:13 +02:00
parent db31ad1080
commit 00b0626b93

View File

@ -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,12 @@ 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} "; } 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 +818,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 +828,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"; }
} }