Page 1 of 1

Netwatch and schedule

Posted: Mon Sep 18, 2023 6:32 pm
by bigsrlcuneo
Hi everyone
We setted multiple netwatch on some hosts on our mikrotik device
It should be used to watchdog our devices around the world; our intention is to be informed when a device lost internet connection, so we setted up a simple type, this is the configuration (we check the connestion in a wireguard peer):
Image
The issue is that the routerboard that made the check reboot itself every day in the night so each reconnection we receive notification that host is going online when it restart
Our intention was to disable the netwatch before the reboot and then re-enable it after the reboot, but evey time a netwatch is disabled then re-enabled it check the host and send notification that host is online

There is a good way to configure a scenario like our needing avoiding this problem?
Thanks
bye

Re: Netwatch and schedule

Posted: Tue Sep 19, 2023 1:15 am
by eworm
You can use my script, it does what you want, and a lot more:
Notify on host up and down

Re: Netwatch and schedule

Posted: Tue Sep 19, 2023 4:45 pm
by bigsrlcuneo
Oh, thanks I've installed it, configured etc and seems good for us

thanks
bye bye

Re: Netwatch and schedule

Posted: Thu Sep 28, 2023 12:30 pm
by bigsrlcuneo
Sorry, one last question: there is a way to customize the email destination for each netwatch or can only use the address configured in the configuration file?
Because we have several host, managed by different person and I wuold send an email to the assigned technician

Is there a way?

Thanks
bye

Re: Netwatch and schedule

Posted: Fri Sep 29, 2023 3:01 pm
by eworm
Currently this is not possible, no... You can give different notification settings for every script, but not for different configuration entities consumed by one scripts.

Though I see the use here... Perhaps I should extend that. 🤔

Re: Netwatch and schedule

Posted: Fri Sep 29, 2023 3:21 pm
by eworm
Let's give it a try... This is required to install the script from next branch:
/system/script/set comment="url-suffix=?h=next" netwatch-notify;
$ScriptInstallUpdate;
See the commit message for details on how to use the new setting:
https://git.eworm.de/cgit/routeros-scri ... 8326512913

Re: Netwatch and schedule

Posted: Fri Oct 06, 2023 4:15 pm
by bigsrlcuneo
Hi

Thank you so much! I've already updated, configured and all works great!
this is an important features for us, so, thank you!

bye bye

Re: Netwatch and schedule

Posted: Sun Oct 08, 2023 12:29 am
by eworm
The change is now merged into the main branch, so you can remove the comment from script:
/system/script/set comment="" netwatch-notify;
(Sounds like this is a big win for you, especially after I made the change for you. So please consider keeping my motivation up...)