Monitor PPP dynamic interface

Hi!

We have an client server calling a MikroTik firewall using PPTP VPN. Since this tunnel is used for a couple of network services it’s important that it stays connected. Unforunetley things go wrong and sometimes the connection drops.

What I want to accomplish is a script running on the MikroTik checking if the PPP client is connected and the dynamic tunnel is up. If down I would like to receive an email.

Since I’m entirely new to scripting on a MikroTik all help given is very appreciated!

Thanks!

/ Kenneth