Extract OpenVPN server status

Started by nothing, March 20, 2020, 06:21:32 AM

Previous topic - Next topic
Hi guys,
Is there a way to get the status of OpenVPN server with all the clients connected?
API doesn't seem to provide such capability. If I try to socat it from the unix socket (/var/etc/openvpn/server1.sock) it breaks the server and reboot is required. SNMP maybe?

Add a status line to your OpenVPN server config file. Details on the man page: https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage

Bart...

Thanks for the idea! Worked!
Now feeding Graphite with data like this:
echo "OpenVPN.clients_count `cat /tmp/openvpn-status.txt | grep CLIENT_LIST | /usr/bin/wc -l` `date +%s`" | /usr/bin/nc -N 192.168.1.100 2003