BobbyJ1's picture

What is the easier way to see who is connected?

I can look at the  /var/log/openvpn/server.log using the web gui but its not live its ok data.

Is there a built in file that gets updated with who is connected?   If not it should be part of the installation package.

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

(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.

Add new comment