aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-13 08:37:11 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-13 09:02:04 +0100
commit3d4a14d44935fff6777a97afb4b598238c57b47e (patch)
tree099a4840be7ca45c59c80227dd2fdbe0dae5c56a
parentccfbabde5eed08a021b2d47f34bc4498940fda1d (diff)
netwatch-notify: pass link to notificationchange-124
This is pass verbatim below the notification text.
-rw-r--r--doc/netwatch-notify.md7
-rw-r--r--global-functions.rsc2
-rw-r--r--netwatch-notify.rsc4
-rw-r--r--news-and-changes.rsc1
4 files changed, 11 insertions, 3 deletions
diff --git a/doc/netwatch-notify.md b/doc/netwatch-notify.md
index 6f3e1ce..806bb3a 100644
--- a/doc/netwatch-notify.md
+++ b/doc/netwatch-notify.md
@@ -111,6 +111,13 @@ included verbatim into the notification.
/tool/netwatch/add comment="notify, name=example, note=Do not touch!" host=10.0.0.31;
+### Add a link in notification
+
+It is possible to add a link in notification, that is added below the
+formatted notification text.
+
+ /tool/netwatch/add comment="notify, name=example.com, resolve=example.com, link=https://example.com/";
+
Tips & Tricks
-------------
diff --git a/global-functions.rsc b/global-functions.rsc
index d33e3e2..e4d0fd2 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -12,7 +12,7 @@
:local ScriptName [ :jobname ];
# expected configuration version
-:global ExpectedConfigVersion 123;
+:global ExpectedConfigVersion 124;
# global variables not to be changed by user
:global GlobalFunctionsReady false;
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc
index 9536dd7..adcfc37 100644
--- a/netwatch-notify.rsc
+++ b/netwatch-notify.rsc
@@ -144,7 +144,7 @@
}
$SendNotification2 ({ origin=[ $EitherOr ($HostInfo->"origin") $ScriptName ]; silent=($HostInfo->"silent"); \
subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Netwatch Notify: " . $Name . " up"); \
- message=$Message });
+ message=$Message; link=($HostInfo->"link") });
}
:set ($Metric->"notified") false;
:set ($Metric->"parent") ($HostInfo->"parent");
@@ -199,7 +199,7 @@
:if ($HostInfo->"no-down-notification" != true) do={
$SendNotification2 ({ origin=[ $EitherOr ($HostInfo->"origin") $ScriptName ]; silent=($HostInfo->"silent"); \
subject=([ $SymbolForNotification "cross-mark" ] . "Netwatch Notify: " . $Name . " down"); \
- message=$Message });
+ message=$Message; link=($HostInfo->"link") });
}
:set ($Metric->"notified") true;
}
diff --git a/news-and-changes.rsc b/news-and-changes.rsc
index 6b0a538..1f1094d 100644
--- a/news-and-changes.rsc
+++ b/news-and-changes.rsc
@@ -48,6 +48,7 @@
121="The 'wifiwave2' scripts are finally gone. Development continues with 'wifi' in RouterOS 7.13 and later.";
122="The global configuration was enhanced to support loading snippets. Configuration can be split off to scripts where name starts with 'global-config-overlay.d/'.";
123="Introduced new function '\$LogPrint', and deprecated '\$LogPrintExit2'. Please update custom scripts if you use it.";
+ 124="Added support for links in 'netwatch-notify', these are added below the formatted notification text.";
};
# Migration steps to be applied on script updates