Notice dsl line lost

Hello, I have this simple configuration.

I have the need to constantly monitor the stability of the line dsl and I would like to receive an alert whenever the call drops dsl.

The mikrotik is connected to the Internet via a modem/router.
For the mikrotik the connection is always active, even if it were missing the line dsl.
I Want use a script or something that performs a test of constant connection and send me an email when the line fails
The email I will have to be sent using a wan2 that I have not shown in the diagram
Unfortunately I’m not able to make such a script and I would like your help.
I would be fine anything that has the function that I described above

Thanks

Research for ping script or how these examples are done

Thanks for the help, I’m using netwatch and seems to work.
I would like to ask another information to avoid opening another post

I’ve been monitoring the pppoe client using the graphing tool.
The problem is that when the client disconnects and then reconnects I lose all graphs prior to disconnection. Is there a way to solve this problem?