aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-notify.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'netwatch-notify.rsc')
-rw-r--r--netwatch-notify.rsc8
1 files changed, 5 insertions, 3 deletions
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc
index 0b6c366..8481314 100644
--- a/netwatch-notify.rsc
+++ b/netwatch-notify.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2020-2024 Christian Hesse <mail@eworm.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
-# requires RouterOS, version=7.13
+# requires RouterOS, version=7.15beta4
#
# monitor netwatch and send notifications
# https://git.eworm.de/cgit/routeros-scripts/about/doc/netwatch-notify.md
@@ -102,7 +102,8 @@
:if ([ :typeof ($HostInfo->"resolve") ] = "str") do={
:if ([ $IsDNSResolving ] = true) do={
:do {
- :local Resolve [ :resolve ($HostInfo->"resolve") ];
+ :local Resolve [ :resolve type=[ $IfThenElse ([ :typeof ($HostVal->"host" ] = "ip") \
+ "ipv4" "ipv6" ] ($HostInfo->"resolve") ];
:if ($Resolve != $HostVal->"host") do={
:if ([ $ResolveExpected $ScriptName ($HostInfo->"resolve") ($HostVal->"host") ] = false) do={
$LogPrint info $ScriptName ("Name '" . $HostInfo->"resolve" . [ $IfThenElse \
@@ -117,7 +118,8 @@
} on-error={
:set ($Metric->"resolve-failcnt") ($Metric->"resolve-failcnt" + 1);
:if ($Metric->"resolve-failcnt" = 3) do={
- $LogPrint warning $ScriptName ("Resolving name '" . $HostInfo->"resolve" . [ $IfThenElse \
+ $LogPrint [ $IfThenElse ($HostInfo->"no-resolve-fail" != true) warning debug ] \
+ $ScriptName ("Resolving name '" . $HostInfo->"resolve" . [ $IfThenElse \
($HostInfo->"resolve" != $HostInfo->"name") ("' for " . $Type . " '" . \
$HostInfo->"name") "" ] . "' failed.");
}