mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
log-forward: inform about rate limit in notification
This commit is contained in:
parent
09d88ad91c
commit
f0f05be8a9
1 changed files with 7 additions and 5 deletions
12
log-forward
12
log-forward
|
@ -74,15 +74,17 @@ $ScriptLock $0;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ($Count > 0) do={
|
:if ($Count > 0) do={
|
||||||
|
:set LogForwardRateLimit ($LogForwardRateLimit + 10);
|
||||||
|
|
||||||
$SendNotification2 ({ origin=$0; \
|
$SendNotification2 ({ origin=$0; \
|
||||||
subject=([ $SymbolForNotification [ $IfThenElse ($Warning = true) "warning-sign" "memo" ] ] . \
|
subject=([ $SymbolForNotification [ $IfThenElse ($Warning = true) "warning-sign" "memo" ] ] . \
|
||||||
"Log Forwarding"); \
|
"Log Forwarding"); \
|
||||||
message=("The log on " . $Identity . " contains " . [ $IfThenElse ($Count = 1) \
|
message=("The log on " . $Identity . " contains " . [ $IfThenElse ($Count = 1) "this message" \
|
||||||
"this message" ("these " . $Count . " messages") ] . " after " . \
|
("these " . $Count . " messages") ] . " after " . [ /system/resource/get uptime ] . " uptime." . \
|
||||||
[ /system/resource/get uptime ] . " uptime." . [ $IfThenElse ($Duplicates = true) \
|
[ $IfThenElse ($Duplicates = true) (" Multi-repeated messages have been skipped.") ] . \
|
||||||
(" Multi-repeated messages have been skipped.") ] . "\n" . $Messages) });
|
[ $IfThenElse ($LogForwardRateLimit > 30) ("\nRate limit in action, delaying forwarding.") ] . \
|
||||||
|
"\n" . $Messages) });
|
||||||
|
|
||||||
:set LogForwardRateLimit ($LogForwardRateLimit + 10);
|
|
||||||
:set LogForwardLast ($MessageVal->".id");
|
:set LogForwardLast ($MessageVal->".id");
|
||||||
} else={
|
} else={
|
||||||
:if ($LogForwardRateLimit > 0) do={
|
:if ($LogForwardRateLimit > 0) do={
|
||||||
|
|
Loading…
Reference in a new issue