The built-in alerts for VPN status will send out emails when VPN goes down and up.
But when the internet connection is not so stable, there're many annoying fault alerts notifying me the VPN goes down and immediately up again, and because it's using email, so most of the time I'll receive two emails together.
That may make me missing other real problems.
I want to write some script using API to monitor the VPN status, and only when the VPN down status last for maybe 3 minutes longer will send me an alert. But for the first step, I find out there is no VPN status in API for me to get.
I don't think there's an API endpoint for that. If I were you I'd try working with the Webhooks API and have some logic in the receiving server that starts a timer when the "vpn down" comes in. If the timer exceeds x minutes that external system could then take action in the form of emails or syslog or snmp.