From b97d5308b11297151f76b4410394077b5829f242 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 19 Nov 2020 21:23:27 +0100 Subject: check-health: guard against temperature spikes Looks like devices out there suffer sensor issue or bug where temperature value spikes and drops immediately: https://forum.mikrotik.com/viewtopic.php?t=111030 https://forum.mikrotik.com/viewtopic.php?t=111109 https://forum.mikrotik.com/viewtopic.php?t=151242 ... and possibly more. Let's ignore these spikes, but at the same time increase the current value to bring it into line - in case it's real. --- check-health | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check-health b/check-health index 8dfbc16..c30eee1 100644 --- a/check-health +++ b/check-health @@ -70,6 +70,12 @@ $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 . \ + "\C2\B0" . "C to " . $Temperature . "\C2\B0" . "C, ignoring.") false; + :set Temperature ($CheckHealthLast->$Name); + :set ($CheckHealthCurrent->$Name) ($CheckHealthLast->$Name + 3); + } :if ($Temperature > $CheckHealthTemperature->$Name && \ $CheckHealthTemperatureNotified->$Name != true) do={ $SendNotification ([ $SymbolForNotification "fire" ] . "Health warning: " . $Name) \ -- cgit v1.2.3-54-g00ecf