check-health: use second measure against temperature spikes

The old spike detection was still prone to false alerts. Let's do a
second measurement and ignore on difference.

This results in more measurements being ignored, but temperature is
changing slowly only and it should not hurt.
This commit is contained in:
Christian Hesse 2020-11-21 21:03:56 +01:00
parent 13f7ba11da
commit af50ed5909

View file

@ -70,11 +70,10 @@
$LogPrintExit info ("No threshold given for " . $Name . ", assuming 50C.") false;
:set ($CheckHealthTemperature->$Name) 50;
}
:if ($Temperature > $CheckHealthLast->$Name + 20) do={
$LogPrintExit info ("The " . $Name . " spikes from " . $CheckHealthLast->$Name . \
"C to " . $Temperature . "C, ignoring.") false;
:if ($Temperature != [ / system health get $Name ]) do={
$LogPrintExit debug ("The second measurement for " . $Name . " differs, ignoring.") false;
:set Temperature ($CheckHealthLast->$Name);
:set ($CheckHealthCurrent->$Name) ($CheckHealthLast->$Name + 3);
:set ($CheckHealthCurrent->$Name) $Temperature;
}
:if ($Temperature > $CheckHealthTemperature->$Name && \
$CheckHealthTemperatureNotified->$Name != true) do={