aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-notify
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-07-05 13:23:34 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-07-06 11:37:02 +0200
commit19103cd3451a9a5a6be6faa8c2745754ddc40606 (patch)
tree2c496efcf121a216690040e94fe55cad05c01ea5 /netwatch-notify
parent5a02c32d7d0c5d8b0951898e040b7918ff1b560a (diff)
netwatch-notify: rename parameter: hostname -> namechange-82
Starting with RouterOS 7.4 the netwatch tool has been extended, it can now do tcp and http probes. Rename the parameter for reasonable naming with services.
Diffstat (limited to 'netwatch-notify')
-rw-r--r--netwatch-notify6
1 files changed, 3 insertions, 3 deletions
diff --git a/netwatch-notify b/netwatch-notify
index d9b8cf0..e1c8e43 100644
--- a/netwatch-notify
+++ b/netwatch-notify
@@ -59,7 +59,7 @@ $ScriptLock $0;
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
:if ($HostInfo->"notify" = true && $HostInfo->"disabled" != true) do={
- :local HostName ($HostInfo->"hostname");
+ :local HostName ($HostInfo->"name");
:local Metric { "count"=0; "notified"=false };
:if ([ :typeof ($NetwatchNotify->$HostName) ] = "array") do={
@@ -72,7 +72,7 @@ $ScriptLock $0;
:local Resolve [ :resolve ($HostInfo->"resolve") ];
:if ($Resolve != $HostVal->"host") do={
$LogPrintExit2 info $0 ("Name '" . $HostInfo->"resolve" . [ $IfThenElse ($HostInfo->"resolve" != \
- $HostInfo->"hostname") ("' for host '" . $HostInfo->"hostname") "" ] . \
+ $HostInfo->"name") ("' for host '" . $HostInfo->"name") "" ] . \
"' resolves to different address " . $Resolve . ", updating.") false;
/tool/netwatch/set host=$Resolve $Host;
:set ($Metric->"resolve-failed") false;
@@ -80,7 +80,7 @@ $ScriptLock $0;
} on-error={
:if ($Metric->"resolve-failed" != true) do={
$LogPrintExit2 warning $0 ("Resolving name '" . $HostInfo->"resolve" . [ $IfThenElse ($HostInfo->"resolve" != \
- $HostInfo->"hostname") ("' for host '" . $HostInfo->"hostname") "" ] . "' failed.") false;
+ $HostInfo->"name") ("' for host '" . $HostInfo->"name") "" ] . "' failed.") false;
:set ($Metric->"resolve-failed") true;
}
}