Community discussions

MikroTik App
 
dakotabcn
newbie
Topic Author
Posts: 49
Joined: Thu Apr 21, 2016 11:16 pm

netwach email where failover

Wed Jul 17, 2019 6:04 pm

Hello
i have created with scheduler this script for verify if fail one of ftth

/system scheduler
add comment="This will run after 4 mins" interval=5m name=ISP1 on-event="/system scheduler set [find name=checker] disabled=yes\r\
\n:local pinged [/ping address=8.8.8.8 count=5 interface=ISP1 size=50]\r\
\n:if ((\$pinged=0)) do={\r\
\n#send email\r\
\n/tool e-mail send subject=(\"Fibra ISP1 caida\") \\\r\
\nbody=(\"LA LINEA ISP1 ESTA CAIDA DESDE \" . [/system clock get time]) \\\r\
\nto=(\"tecnico@\")\r\
\n/system scheduler set [find name=backupwan] disabled=no\r\
\n}\r\
\n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=jun/21/2019 start-time=17:31:44
add comment="This will run after 4 mins" interval=5m name=ISP2 on-event="/system scheduler set [find name=checker] disabled=yes\r\
\n:local pinged [/ping address=8.8.8.8 count=5 interface=ISP2 size=50]\r\
\n:if ((\$pinged=0)) do={\r\
\n#send email\r\
\n/tool e-mail send subject=(\" Fibra ISP2 caida\") \\\r\
\nbody=(\"LA LINEA ISP2 ESTA CAIDA DESDE \" . [/system clock get time]) \\\r\
\nto=(\"tecnico@\")\r\
\n/system scheduler set [find name=backupwan] disabled=no\r\
\n}\r\
\n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=jun/21/2019 start-time=20:21:53

the problem is that this makes every 5 minutes send us an email with the notice that the line is down
I have installed a netwatch in another client to control a site2site that, if it fails, warns us, works well and I would like to change the scheduler, but I can not find or do not think of how to check that a fiber has fallen (put the IP of the GW not it serves me, since it could fail only the fiber and the gw respond)
Does anyone have experience in how to solve this or do I maintain the scheduler?

the control of the vpn s2s with netwach
/tool netwatch
add comment="CONTROL VPN S2S" down-script="/tool e-mail send subject=(\"ALERT\
A: VPN S2S caida\") \\\r\
\nbody=(\"LA VPN S2S ESTA CAIDA DESDE \" . [/system clock get time])\
\_\\\r\
\nto=(\"tecnico@\")" host=192.168.200.1 up-script="/tool e-mail sen\
d subject=(\"ALERTA: VPN S2S activa\") \\\r\
\nbody=(\"LA VPN S2S ESTA ACTIVA DE NUEVO DESDE \" . [/system clock \
get time]) \\\r\
\nto=(\"tecnico@\")"
 
stoser
Member Candidate
Member Candidate
Posts: 123
Joined: Sun Aug 21, 2016 12:04 am

Re: netwach email where failover

Thu Jul 18, 2019 3:59 am

First I would like to understand what exactly is the problem that you are having. Is the problem that you prefer to use the scheduler instead of the s2s solution over netwatch, but would prefer to only receive just one email per fault (instead of one email every 5 minutes)? Or is the problem that you would prefer to use the the s2s solution but need a way to test if a specific line is down by pinging past the gateway to a real outside site/responder?

Who is online

Users browsing this forum: abbio90, alixviral and 56 guests