mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-04 13:09:37 +00:00
Compare commits
9 commits
8dcdc4b086
...
66764ed0b2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66764ed0b2 | ||
|
|
e694477fdc | ||
|
|
875ac9f7c3 | ||
|
|
49d3a448c6 | ||
|
|
9b2099e402 | ||
|
|
679583bbbf | ||
|
|
df8d0370c5 | ||
|
|
cc56680206 | ||
|
|
6fd28bf8f7 |
3 changed files with 10 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ Forward log messages via notification
|
|||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||
[](https://mikrotik.com/download/changelogs/)
|
||||
[](https://mikrotik.com/download/changelogs/)
|
||||
[](https://t.me/routeros_scripts)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2020-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.22beta1
|
||||
#
|
||||
# forward log messages via notification
|
||||
# https://rsc.eworm.de/doc/log-forward.md
|
||||
|
|
@ -37,8 +37,9 @@
|
|||
:error false;
|
||||
}
|
||||
|
||||
# LogForwardLast is not initialized, by intention: we want
|
||||
# to catch *0 on first invocation!
|
||||
:if ([ :typeof $LogForwardLast ] = "nothing") do={
|
||||
:set LogForwardLast false;
|
||||
}
|
||||
|
||||
:if ([ :typeof $LogForwardRateLimit ] = "nothing") do={
|
||||
:set LogForwardRateLimit 0;
|
||||
|
|
@ -64,10 +65,10 @@
|
|||
:set LogForwardIncludeMessage [ $EitherOr $LogForwardIncludeMessage [] ];
|
||||
|
||||
:local LogAll [ /log/find ];
|
||||
:local LogForwardMax ($LogAll->([ :len $LogAll ] - 1) );
|
||||
:local Max ($LogAll->([ :len $LogAll ] - 1));
|
||||
:local LogForwardFilterLogForwardingCached [ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ];
|
||||
|
||||
:foreach Message in=[ /log/find where .id>$LogForwardLast and .id<=$LogForwardMax and \
|
||||
:foreach Message in=[ /log/find where .id>$LogForwardLast and .id<=$Max and \
|
||||
((!(message="") and !(message~$LogForwardFilterLogForwardingCached) and \
|
||||
!(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
|
||||
topics~$LogForwardInclude or message~$LogForwardIncludeMessage) ] do={
|
||||
|
|
@ -108,7 +109,7 @@
|
|||
:set LogForwardRateLimit [ $MAX 0 ($LogForwardRateLimit - 1) ];
|
||||
}
|
||||
|
||||
:set LogForwardLast $LogForwardMax;
|
||||
:set LogForwardLast $Max;
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@
|
|||
|
||||
:foreach DohServer in=$DohServers do={
|
||||
:if ([ :len ($DohServer->"doh-cert") ] > 0) do={
|
||||
:if ([ $CertificateAvailable ($DohServer->"doh-cert") "dns" ] = false) do={
|
||||
:if ([ $CertificateAvailable ($DohServer->"doh-cert") "fetch" ] = false || \
|
||||
[ $CertificateAvailable ($DohServer->"doh-cert") "dns" ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Downloading certificate failed, trying without.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue