Check if a pfsense VPN tunnel is UP and alert when it's DOWN.
- pfsense 2.7.2
- Uptime Kuma
In Uptime Kuma create a Push Monitor and note the Push URL.
Download script to your pfsense home directory
wget https://github.com/hhanzo1/check-tunnel/blob/main/check-vpn-tunnel.sh
chmod +x check-vpn-tunnel.sh
Update the script with the tunnel name (ie. ovpnc1 or ovpnc2) and the Uptime Kuma Push URL.
Run the script manually to check it is working as expected, then scheduled via cron.
# Run every minute
* * * * * /home/[USERID]/check-vpn-tunnel.sh
If the Push URL does not receive a HTTP request within the Heart Beat internal (default 60 seconds), an alert can be triggered.
Status and Uptime Uptime Kuma Badges can be configured.