1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

early-errors: get errors into array

This commit is contained in:
Christian Hesse
2020-04-24 23:14:58 +02:00
parent 0a48f37918
commit 940c1e9381

View File

@@ -9,11 +9,12 @@
:global SendNotification;
:local ErrCount [ / log print count-only where topics~"error" ];
:local Errors [ / log find where topics~"error" ];
:local ErrCount [ :len $Errors ];
:if ($ErrCount > 0) do={
:local Message ("The log on " . $Identity . " contains " . $ErrCount . \
" errors after " . [ / system resource get uptime ] . " uptime.\n");
:foreach Log in=[ / log find where topics~"error" ] do={
:foreach Log in=$Errors do={
:local LogVal [ / log get $Log ];
:set Message ($Message . "\n" . [ :tostr ($LogVal->"topics") ] . \
" " . ($LogVal->"message"));