aboutsummaryrefslogtreecommitdiffstats
path: root/check-health
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-08-27 15:20:11 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-08-27 15:20:11 +0200
commitb74d465cd050dff793d44ceca78ce6e9745a016b (patch)
treed66d5a6696c5428bae9db279acb3c4899b2a9acb /check-health
parent29dc1b884154d14b45ebf7471f59ec0755bab549 (diff)
check-health: also send recovery notifications
Diffstat (limited to 'check-health')
-rw-r--r--check-health11
1 files changed, 11 insertions, 0 deletions
diff --git a/check-health b/check-health
index b69ae4a..7c7f169 100644
--- a/check-health
+++ b/check-health
@@ -36,6 +36,11 @@
$SendNotification ("Health warning: " . $PSU . " state") \
("The power supply unit '" . $PSU . "' on " . $Identity . " failed!");
}
+ :if ($CheckHealthLast->($PSU . "-state") != "ok" && \
+ $CheckHealthCurrent->($PSU . "-state") = "ok") do={
+ $SendNotification ("Health recovery: " . $PSU . " state") \
+ ("The power supply unit '" . $PSU . "' on " . $Identity . " recovered!");
+ }
}
:foreach Temperature in={ "temperature"; "cpu-temperature"; "board-temperature1"; "board-temperature2" } do={
@@ -51,6 +56,12 @@
("The " . $Temperature . " on " . $Identity . " is above threshold: " . \
$CheckHealthCurrent->$Temperature . "C");
}
+ :if ($CheckHealthLast->$Temperature > $CheckHealthTemperature->$Temperature && \
+ $CheckHealthCurrent->$Temperature <= $CheckHealthTemperature->$Temperature) do={
+ $SendNotification ("Health recovery: " . $Temperature) \
+ ("The " . $Temperature . " on " . $Identity . " dropped below threshold: " . \
+ $CheckHealthCurrent->$Temperature . "C");
+ }
}
}