mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-health: silently exit without health readings...
... but after checking CPU load and free RAM.
This commit is contained in:
parent
6780e1a24c
commit
e9a426a798
1 changed files with 11 additions and 11 deletions
22
check-health
22
check-health
|
@ -33,17 +33,6 @@
|
||||||
:return ($T->0 * 10 + $T->1);
|
:return ($T->0 * 10 + $T->1);
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len [ /system/health/find ] ] = 0) do={
|
|
||||||
$LogPrintExit2 error $0 ("Your device does not provide any health values.") true;
|
|
||||||
}
|
|
||||||
|
|
||||||
:if ([ :typeof $CheckHealthLast ] != "array") do={
|
|
||||||
:set CheckHealthLast ({});
|
|
||||||
}
|
|
||||||
:if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={
|
|
||||||
:set CheckHealthTemperatureNotified ({});
|
|
||||||
}
|
|
||||||
|
|
||||||
$ScriptLock $0;
|
$ScriptLock $0;
|
||||||
|
|
||||||
:local Resource [ /system/resource/get ];
|
:local Resource [ /system/resource/get ];
|
||||||
|
@ -78,6 +67,17 @@ $ScriptLock $0;
|
||||||
:set CheckHealthFreeRAMNotified false;
|
:set CheckHealthFreeRAMNotified false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:if ([ :len [ /system/health/find ] ] = 0) do={
|
||||||
|
$LogPrintExit2 debug $0 ("Your device does not provide any health values.") true;
|
||||||
|
}
|
||||||
|
|
||||||
|
:if ([ :typeof $CheckHealthLast ] != "array") do={
|
||||||
|
:set CheckHealthLast ({});
|
||||||
|
}
|
||||||
|
:if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={
|
||||||
|
:set CheckHealthTemperatureNotified ({});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
:foreach Voltage in=[ /system/health/find where type="V" ] do={
|
:foreach Voltage in=[ /system/health/find where type="V" ] do={
|
||||||
:local Name [ /system/health/get $Voltage name ];
|
:local Name [ /system/health/get $Voltage name ];
|
||||||
|
|
Loading…
Reference in a new issue