diff options
author | Christian Hesse <mail@eworm.de> | 2020-07-15 12:22:55 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-07-15 12:41:29 +0200 |
commit | 6bce0a4b6a3d1ee48a1e4b4f40652ae490fb288c (patch) | |
tree | 5cff4a2b93eb6d0d305cd8f824cf6d9d63c3c206 /early-errors | |
parent | 9740b1f26993bafe09834e19a0275036e2f5c22a (diff) |
add 'log-forward', drop 'early-errors'change-23
Diffstat (limited to 'early-errors')
-rw-r--r-- | early-errors | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/early-errors b/early-errors index a2c5da3..4f411f4 100644 --- a/early-errors +++ b/early-errors @@ -1,28 +1,6 @@ #!rsc # RouterOS script: early-errors -# Copyright (c) 2020 Christian Hesse <mail@eworm.de> -# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md -# -# send notification with early errors -# https://git.eworm.de/cgit/routeros-scripts/about/doc/early-errors.md -:global Identity; +:global LogPrintExit; -:global SendNotification; -:global WaitFullyConnected; - -$WaitFullyConnected; - -:local Errors [ / log find where (topics~"error" or topics~"critical") \ - !(topics~"certificate") !(topics~"dns") !(topics~"e-mail") ]; -: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=$Errors do={ - :local LogVal [ / log get $Log ]; - :set Message ($Message . "\n" . [ :tostr ($LogVal->"topics") ] . \ - " " . ($LogVal->"message")); - } - $SendNotification ("\E2\9A\A0 Early errors") ($Message); -} +$LogPrintExit warning ("This script has been replaced. Please migrate to 'log-forward'.") true; |