diff options
author | Christian Hesse <mail@eworm.de> | 2020-11-19 21:23:27 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-11-19 21:23:27 +0100 |
commit | b97d5308b11297151f76b4410394077b5829f242 (patch) | |
tree | 3e5dc37072ab75b3ef85e23711568402c4fde033 | |
parent | 88f9948c722ad003864470f85abf85c3e419e3c5 (diff) |
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.
-rw-r--r-- | check-health | 6 |
1 files changed, 6 insertions, 0 deletions
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) \ |