ipmitool often fails - just keep using the previous result til it succeeds
This commit is contained in:
parent
50cfcf0bc5
commit
e41c1aa38e
1 changed files with 3 additions and 2 deletions
|
|
@ -155,6 +155,7 @@ END {
|
||||||
|
|
||||||
my $last_reset_hddtemps=time;
|
my $last_reset_hddtemps=time;
|
||||||
my $last_reset_ambient_ipmitemps=time;
|
my $last_reset_ambient_ipmitemps=time;
|
||||||
|
my $ambient_temp=20;
|
||||||
while () {
|
while () {
|
||||||
if (!@hddtemps) {
|
if (!@hddtemps) {
|
||||||
# could just be a simple pipe, but hddtemp has a strong posibility
|
# could just be a simple pipe, but hddtemp has a strong posibility
|
||||||
|
|
@ -164,7 +165,7 @@ while () {
|
||||||
@hddtemps=`grep [0-9] < $tempfilename`;
|
@hddtemps=`grep [0-9] < $tempfilename`;
|
||||||
}
|
}
|
||||||
if (!@ambient_ipmitemps) {
|
if (!@ambient_ipmitemps) {
|
||||||
@ambient_ipmitemps=`timeout -k 1 20 ipmitool sdr type temperature | grep "$ipmi_inlet_sensorname" | grep [0-9]`
|
@ambient_ipmitemps=`timeout -k 1 20 ipmitool sdr type temperature | grep "$ipmi_inlet_sensorname" | grep [0-9] || echo " | $ambient_temp degrees C"` # ipmitool often fails - just keep using the previous result til it succeeds
|
||||||
}
|
}
|
||||||
@coretemps=`timeout -k 1 20 sensors | grep [0-9]`;
|
@coretemps=`timeout -k 1 20 sensors | grep [0-9]`;
|
||||||
@cputemps=grep {/^Package id/} @coretemps;
|
@cputemps=grep {/^Package id/} @coretemps;
|
||||||
|
|
@ -190,7 +191,7 @@ while () {
|
||||||
print "ambient_ipmitemps=", join (" ; ", @ambient_ipmitemps), "\n";
|
print "ambient_ipmitemps=", join (" ; ", @ambient_ipmitemps), "\n";
|
||||||
print "hddtemps=", join (" ; ", @hddtemps), "\n";
|
print "hddtemps=", join (" ; ", @hddtemps), "\n";
|
||||||
|
|
||||||
my $ambient_temp = average(@ambient_ipmitemps);
|
$ambient_temp = average(@ambient_ipmitemps);
|
||||||
# FIXME: hysteresis
|
# FIXME: hysteresis
|
||||||
if ($ambient_temp > $default_threshold) {
|
if ($ambient_temp > $default_threshold) {
|
||||||
print "fallback because of high ambient temperature $ambient_temp > $default_threshold\n";
|
print "fallback because of high ambient temperature $ambient_temp > $default_threshold\n";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue