I'm writing some simple netwatch code to monitor some network device state with mikrotik NetWatch and telegram.
netwatch
up:
Code: Select all
/tool fetch url="telegram bot get api url with message - link up" keep-result=no
Code: Select all
/tool fetch url="telegram bot get api url with message - link down" keep-result=no
Code: Select all
ip = some ip
interval = 60 sec
timeout = 5 sec
now i rewrite it, with
down
Code: Select all
:if ([/ping IP interval=1 count=10] = 0) do={
/tool fetch url="telegram bot get api url with message - link down" keep-result=no
}
Code: Select all
:if ([/ping IP interval=1 count=10] != 0) do={
/tool fetch url="telegram bot get api url with message - link up" keep-result=no
}
But it stay to often send about link UP.
How properly solve this case?