aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-11-21 21:03:56 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-11-24 13:45:57 +0100
commitaf50ed590923af80ad4e996a199a13dd1ca90e5e (patch)
treefe36eb9472e4a207d5ea8bb1a1442630dff8f51f
parent13f7ba11da598e903b6d4835f34c89a56a26ec45 (diff)
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.
-rw-r--r--check-health7
1 files changed, 3 insertions, 4 deletions
diff --git a/check-health b/check-health
index 1e7c1b4..bb75fa0 100644
--- a/check-health
+++ b/check-health
@@ -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={