mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-health: also send recovery notifications
This commit is contained in:
parent
29dc1b8841
commit
b74d465cd0
1 changed files with 11 additions and 0 deletions
11
check-health
11
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue