mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-27 06:14:38 +02:00
log-forward: use colorful bullets to indicate severity
This commit is contained in:
parent
ef3b8f8ddd
commit
24823441c3
3 changed files with 12 additions and 4 deletions
|
@ -12,7 +12,7 @@
|
||||||
:local 0 "global-functions";
|
:local 0 "global-functions";
|
||||||
|
|
||||||
# expected configuration version
|
# expected configuration version
|
||||||
:global ExpectedConfigVersion 107;
|
:global ExpectedConfigVersion 108;
|
||||||
|
|
||||||
# global variables not to be changed by user
|
# global variables not to be changed by user
|
||||||
:global GlobalFunctionsReady false;
|
:global GlobalFunctionsReady false;
|
||||||
|
@ -1230,6 +1230,9 @@
|
||||||
"floppy-disk"="\F0\9F\92\BE";
|
"floppy-disk"="\F0\9F\92\BE";
|
||||||
"high-voltage-sign"="\E2\9A\A1";
|
"high-voltage-sign"="\E2\9A\A1";
|
||||||
"incoming-envelope"="\F0\9F\93\A8";
|
"incoming-envelope"="\F0\9F\93\A8";
|
||||||
|
"information"="\E2\84\B9";
|
||||||
|
"large-orange-circle"="\F0\9F\9F\A0";
|
||||||
|
"large-red-circle"="\F0\9F\94\B4";
|
||||||
"link"="\F0\9F\94\97";
|
"link"="\F0\9F\94\97";
|
||||||
"lock-with-ink-pen"="\F0\9F\94\8F";
|
"lock-with-ink-pen"="\F0\9F\94\8F";
|
||||||
"memo"="\F0\9F\93\9D";
|
"memo"="\F0\9F\93\9D";
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
:global LogForwardIncludeMessage;
|
:global LogForwardIncludeMessage;
|
||||||
:global LogForwardLast;
|
:global LogForwardLast;
|
||||||
:global LogForwardRateLimit;
|
:global LogForwardRateLimit;
|
||||||
:global NotificationsWithSymbols;
|
|
||||||
|
|
||||||
:global EitherOr;
|
:global EitherOr;
|
||||||
:global HexToNum;
|
:global HexToNum;
|
||||||
|
@ -53,14 +52,19 @@ $ScriptLock $0;
|
||||||
!(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
|
!(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
|
||||||
topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={
|
topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={
|
||||||
:set MessageVal [ /log/get $Message ];
|
:set MessageVal [ /log/get $Message ];
|
||||||
|
:local Bullet "information";
|
||||||
|
|
||||||
:if ($Last < [ $HexToNum ($MessageVal->".id") ]) do={
|
:if ($Last < [ $HexToNum ($MessageVal->".id") ]) do={
|
||||||
:local DupCount ($MessageDups->($MessageVal->"message"));
|
:local DupCount ($MessageDups->($MessageVal->"message"));
|
||||||
:if ($MessageVal->"topics" ~ "(emergency|alert|critical|error|warning)") do={
|
:if ($MessageVal->"topics" ~ "(warning)") do={
|
||||||
:set Warning true;
|
:set Warning true;
|
||||||
|
:set Bullet "large-orange-circle";
|
||||||
|
}
|
||||||
|
:if ($MessageVal->"topics" ~ "(emergency|alert|critical|error)") do={
|
||||||
|
:set Bullet "large-red-circle";
|
||||||
}
|
}
|
||||||
:if ($DupCount < 3) do={
|
:if ($DupCount < 3) do={
|
||||||
:set Messages ($Messages . "\n" . [ $IfThenElse ($NotificationsWithSymbols = true) (" \E2\97\8F ") ] . \
|
:set Messages ($Messages . "\n" . [ $SymbolForNotification $Bullet ] . \
|
||||||
$MessageVal->"time" . " " . [ :tostr ($MessageVal->"topics") ] . " " . $MessageVal->"message");
|
$MessageVal->"time" . " " . [ :tostr ($MessageVal->"topics") ] . " " . $MessageVal->"message");
|
||||||
} else={
|
} else={
|
||||||
:set Duplicates true;
|
:set Duplicates true;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
105="Extended 'check-routeros-update' to support automatic update from specific neighbor(s).";
|
105="Extended 'check-routeros-update' to support automatic update from specific neighbor(s).";
|
||||||
106="Modified 'telegram-chat' to make it act on message replies, without activation. Also made it answer a single question mark with a short notice.";
|
106="Modified 'telegram-chat' to make it act on message replies, without activation. Also made it answer a single question mark with a short notice.";
|
||||||
107="Dropped support for non-fixed width font in Telegram notifications.";
|
107="Dropped support for non-fixed width font in Telegram notifications.";
|
||||||
|
108="Enhanced 'log-forward' to list log messages with colorful bullets to indicate severity.";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Migration steps to be applied on script updates
|
# Migration steps to be applied on script updates
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue