mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-health: check for valid psu state data
This is required with recovery notifications
This commit is contained in:
parent
b74d465cd0
commit
63ca79b960
|
@ -31,6 +31,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:foreach PSU in={ "psu1"; "psu2" } do={
|
:foreach PSU in={ "psu1"; "psu2" } do={
|
||||||
|
:if ([ :typeof ($CheckHealthLast->($PSU . "-state")) ] = "str" && \
|
||||||
|
[ :typeof ($CheckHealthCurrent->($PSU . "-state")) ] = "str") do={
|
||||||
:if ($CheckHealthLast->($PSU . "-state") = "ok" && \
|
:if ($CheckHealthLast->($PSU . "-state") = "ok" && \
|
||||||
$CheckHealthCurrent->($PSU . "-state") != "ok") do={
|
$CheckHealthCurrent->($PSU . "-state") != "ok") do={
|
||||||
$SendNotification ("Health warning: " . $PSU . " state") \
|
$SendNotification ("Health warning: " . $PSU . " state") \
|
||||||
|
@ -41,6 +43,7 @@
|
||||||
$SendNotification ("Health recovery: " . $PSU . " state") \
|
$SendNotification ("Health recovery: " . $PSU . " state") \
|
||||||
("The power supply unit '" . $PSU . "' on " . $Identity . " recovered!");
|
("The power supply unit '" . $PSU . "' on " . $Identity . " recovered!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:foreach Temperature in={ "temperature"; "cpu-temperature"; "board-temperature1"; "board-temperature2" } do={
|
:foreach Temperature in={ "temperature"; "cpu-temperature"; "board-temperature1"; "board-temperature2" } do={
|
||||||
|
|
Loading…
Reference in a new issue