This is a pretty simple PHP script that allows you to access your (OpenVPN-based) VPN status (such as connected hosts, received/transferred bytes, etc) through a web page. It fetches the information using OpenVPN management console and displays it in a web-friendly way.
Installation is straightforward:
- Download the script (see link below), rename it, and place it in a web accessible location. Example:
/var/www/vpnstatus.php
- Enable OpenVPN management console (if you haven't already done so) adding the following line to the OpenVPN configuration file:
management localhost 7505
- Restart OpenVPN
That's it!. Just access http://yourhost/vpnstatus.php to see your VPN status in a web-friendly way.
This instructions assume you'll place the script on the same machine running OpenVPN. Otherwise, you'll have to edit the script and modifiy it accordingly (changing the localhost to the name of your OpenVPN host) and also change the management
option in your OpenVPN configuration to listen in other addresses.
Download the script here: vpnstatus.txt. Don't forget to rename it to a .php extension.