Commit graph

38 commits

Author SHA1 Message Date
Christian Hesse
a832fd04ef rename scripts and add file extension ".rsc"
No functional change for the user... The migration is done
automatically.
2023-03-07 22:26:01 +01:00
Christian Hesse
072d349473 log-forward: cache the result of $LogForwardFilterLogForwarding
Looks like the function is called for every message to match otherwise. 😳
2023-01-20 11:26:53 +01:00
Christian Hesse
329bef94df log-forward: do not declare unused function 2023-01-11 12:28:31 +01:00
Christian Hesse
868557a24a log-forward: generate filter in mod/notification-email 2023-01-11 12:28:31 +01:00
Christian Hesse
2f774f723d update copyright for 2023 2023-01-02 23:49:26 +01:00
Christian Hesse
164ebe8c8a log-forward: update initialization of empty array
Having the parenthesis here is important for valid syntax!
2022-07-13 11:33:58 +02:00
Christian Hesse
e9780d9b4e log-forward: fix the pattern excluding mail errors
This looked smart, but did not work... 🤪
Unicode characters have to be in place to make $QuotedPrintable have an
effect. So fix it... We have duplicate pattern if symbols are disabled,
but that does not hurt.
2022-06-08 21:05:08 +02:00
Christian Hesse
f0f05be8a9 log-forward: inform about rate limit in notification 2022-06-02 11:14:36 +02:00
Christian Hesse
61c9b29ec3 log-forward: use warning-sign for severity warning and up 2022-06-02 11:14:36 +02:00
Christian Hesse
89f4c91ccf log-forward: change symbol for notification 2022-05-20 08:33:22 +02:00
Christian Hesse
0e73f85c11 log-forward: do *not* wait to be fully connected
Let's forward logs as early as possible.

All notification functions are expected to handle notifications with
queues, so nothing is lost. Just the opposite: Logs being rotated before
forwarding becomes less likely.
2022-05-16 12:42:38 +02:00
Christian Hesse
1c56809cd4 log-forward: RouterOS v7 path syntax 2022-05-11 13:48:27 +02:00
Christian Hesse
95e9820718 update copyright for 2022 2022-01-01 21:38:15 +01:00
Christian Hesse
ee57ddf595 log-forward: fix forwarding first message
Pulling the power cable results in log message on next boot:

dec/16 18:28:28 system,error,critical router rebooted without proper shutdown, probably power outage

This was not forwarded as it had the numeric id 0, which is not greater
than the zero we initialized with. Now initialized with -1 when no log
has been forwarded to fix this.
2021-12-17 11:48:25 +01:00
Christian Hesse
1ce0f63ef7 log-forward: use $HexToNum, do not resend old messages
Now we know the order of messages and can compare. Changing the filter
does no longer result in old messages being resent.
2021-06-15 16:59:02 +02:00
Christian Hesse
de61c14c60 log-forward: implement reverse logic to include messages...
... even if a filter matches to exclude them. Let's have an example:

:global LogForwardFilter "(debug|info)";
:global LogForwardInclude "account";

This will forward everything about topic *account* (login, logout,
failed login, ...) - even with topic *info*.
2021-06-09 14:42:43 +02:00
Christian Hesse
87cbc1edad log-forward: pass origin to $SendNotification2 2021-04-28 13:58:37 +02:00
Christian Hesse
81f84353cd log-forward: use $SendNotification2 2021-04-28 13:58:37 +02:00
Christian Hesse
5610926d0a log-forward: use $EscapeForRegEx 2021-03-17 08:55:33 +01:00
Christian Hesse
baa096fe03 log-forward: filter e-mail error on log forwarding in script...
... and update the filter in global configuration.
2021-03-15 12:40:14 +01:00
Christian Hesse
b1647c760c log-forward: list messages with 'black circle' 2021-03-04 18:47:55 +01:00
Christian Hesse
f762d395eb log-forward: skip multi-repeated messages 2021-03-04 18:44:34 +01:00
Christian Hesse
041ca062b1 global: use $0 for $ScriptLock 2021-02-24 21:51:56 +01:00
Christian Hesse
f46db91845 global: give script or function name in log messages 2021-02-24 21:51:54 +01:00
Christian Hesse
d5afc79eed global: drop script 'global-wait'
All scripts wait for the global functions on their own now.
2021-02-18 21:45:38 +01:00
Christian Hesse
efca1ec049 global-functions: drop $MailServerIsUp
Now that we have an e-mail queue we do not care if the server is up or not.
2021-02-16 16:45:13 +01:00
Christian Hesse
547fbc630a update copyright for 2021 2021-01-01 21:33:52 +01:00
Christian Hesse
16d3709030 log-forward: add 'if any' in log message 2020-12-14 23:39:50 +01:00
Christian Hesse
4a85deb45c log-forward: improve wording for single message 2020-10-18 20:16:54 +02:00
Christian Hesse
744542e925 log-forward: add rate limit to prevent flooding 2020-09-28 20:20:19 +02:00
Christian Hesse
d53cf3e8e7 log-forward: fix usage of function 2020-09-28 19:56:45 +02:00
Christian Hesse
697e32a306 log-forward: add filter on log message text 2020-09-25 22:21:59 +02:00
Christian Hesse
49737af6d1 extend magic pattern with "by RouterOS"
This matches the string included in export.
2020-09-18 11:00:27 +02:00
Christian Hesse
b27d875111 log-forward: lock script to run just once 2020-07-17 20:52:52 +02:00
Christian Hesse
075859c898 global-functions: introduce and use $SymbolForNotification 2020-07-17 08:12:00 +02:00
Christian Hesse
1b55c9b5a2 log-forward: use $SymbolByUnicodeName 2020-07-17 07:52:56 +02:00
Christian Hesse
96d473cfe8 log-forward: remember the last id only 2020-07-15 14:43:26 +02:00
Christian Hesse
6bce0a4b6a add 'log-forward', drop 'early-errors' 2020-07-15 12:41:29 +02:00