Jeremy Davis's picture

According to google (TBH, I'm not particularly familiar with OpenVPN) if you have this line in your config (/etc/openvpn/server.conf):

status /var/log/openvpn-status.log

Then you could create a script to poll the log and report. According to StackExchange something like this should work:

while true; do
    sed -n '/OpenVPN CLIENT LIST/,/ROUTING TABLE/p' /var/log/openvpn-status.log | tail -n+4 | sed "s/ROUTING TABLE//g"
    sleep 60
done

(I mildly modified the script, but the above should give identical result). To set that up so it runs all the time, you'd probably want to create a fairly simple systemd service and then you could check for connections via the journal. Or log to a specific (different) file.

Please let me know how it goes and if we can confirm that it works then we could consider adding it to the appliance by default.