mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-health: give error on messing health values
This commit is contained in:
parent
8b2df7abd0
commit
3e72d1ec0b
1 changed files with 4 additions and 0 deletions
|
@ -22,6 +22,10 @@
|
||||||
|
|
||||||
:local CheckHealthCurrent [ / system health get ];
|
:local CheckHealthCurrent [ / system health get ];
|
||||||
|
|
||||||
|
:if ([ :len $CheckHealthCurrent ] = 0) do={
|
||||||
|
$LogPrintExit error ("Your device does not provide any health values.") true;
|
||||||
|
}
|
||||||
|
|
||||||
:foreach Voltage in={ "battery"; "psu1-voltage"; "psu2-voltage"; "voltage" } do={
|
:foreach Voltage in={ "battery"; "psu1-voltage"; "psu2-voltage"; "voltage" } do={
|
||||||
:if ([ :typeof ($CheckHealthLast->$Voltage) ] = "num" && \
|
:if ([ :typeof ($CheckHealthLast->$Voltage) ] = "num" && \
|
||||||
[ :typeof ($CheckHealthCurrent->$Voltage) ] = "num") do={
|
[ :typeof ($CheckHealthCurrent->$Voltage) ] = "num") do={
|
||||||
|
|
Loading…
Reference in a new issue