check-health: silently exit without health readings...

... but after checking CPU load and free RAM.
This commit is contained in:
Christian Hesse 2023-01-20 14:37:50 +01:00
parent 6780e1a24c
commit e9a426a798
1 changed files with 11 additions and 11 deletions

View File

@ -33,17 +33,6 @@
: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;
:local Resource [ /system/resource/get ];
@ -78,6 +67,17 @@ $ScriptLock $0;
: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={
:local Name [ /system/health/get $Voltage name ];