Script sending email link failover

I have two link’s input, configured fail over, by NetWatch. The route of the secondary link is disabled, when the primary link goes down, the secondary route is up, and when I have ping response back on the main route, the secondary is off again and the traffic exits the page. The issue is that I would like to set up a script to send an email to each of these events, when the primary link goes off, be sent an email as the link secondary would be in operation, and when the primary link back to operate, would be sent another e-mail stating the event.
Scripts.JPG
Redes e Rotas.jpg
Netwatch.JPG

Hi, I’m trying to do the same thing that you are doing. What is the script you are using? Or you can explain to me how the scripts you post works, I’m new at this.

And my solution for the mail sending is to put this script on the netwatch UP and DOWN tabs
UP
/tool e-mail send to=“user@mail.com” subject=“OK” body=“Link UP”
DOWN
/tool e-mail send to=“user@mail.com” subject=“ALERT” body=“Link DOWN”

I hope it helps you.

Greetings