mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
netwatch-notify: allow to suppress resolve failure
This commit is contained in:
@ -104,6 +104,15 @@ powered off, but accessibility is of interest.
|
|||||||
|
|
||||||
Go and get your coffee ☕️ before sending the print job.
|
Go and get your coffee ☕️ before sending the print job.
|
||||||
|
|
||||||
|
### No log on failed resolve
|
||||||
|
|
||||||
|
A message is writting to log after three failed attemts to resolve a host.
|
||||||
|
However this can cause some noise for hosts that are expected to have
|
||||||
|
failures, for example when the name is dynamically added by
|
||||||
|
[`dhcp-to-dns`](dhcp-to-dns.md). This can be suppressed:
|
||||||
|
|
||||||
|
/tool/netwatch/add comment="notify, name=client, resolve=client.dhcp.example.com, no-resolve-fail" host=10.0.0.0;
|
||||||
|
|
||||||
### Add a note in notification
|
### Add a note in notification
|
||||||
|
|
||||||
For some extra information it is possible to add a text note. This is
|
For some extra information it is possible to add a text note. This is
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
}
|
}
|
||||||
} on-error={
|
} on-error={
|
||||||
:set ($Metric->"resolve-failcnt") ($Metric->"resolve-failcnt" + 1);
|
:set ($Metric->"resolve-failcnt") ($Metric->"resolve-failcnt" + 1);
|
||||||
:if ($Metric->"resolve-failcnt" = 3) do={
|
:if ($Metric->"resolve-failcnt" = 3 && $HostInfo->"no-resolve-fail" != true) do={
|
||||||
$LogPrint warning $ScriptName ("Resolving name '" . $HostInfo->"resolve" . [ $IfThenElse \
|
$LogPrint warning $ScriptName ("Resolving name '" . $HostInfo->"resolve" . [ $IfThenElse \
|
||||||
($HostInfo->"resolve" != $HostInfo->"name") ("' for " . $Type . " '" . \
|
($HostInfo->"resolve" != $HostInfo->"name") ("' for " . $Type . " '" . \
|
||||||
$HostInfo->"name") "" ] . "' failed.");
|
$HostInfo->"name") "" ] . "' failed.");
|
||||||
|
Reference in New Issue
Block a user