mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-31 00:04:51 +02:00
early-errors: get errors into array
This commit is contained in:
parent
0a48f37918
commit
940c1e9381
1 changed files with 3 additions and 2 deletions
|
@ -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"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue