From af50ed590923af80ad4e996a199a13dd1ca90e5e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 21 Nov 2020 21:03:56 +0100 Subject: 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. --- check-health | 7 +++---- 1 file 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={ -- cgit v1.2.3-70-g09d2