Graph amount of OpenVPN users to Munin
Rather simple script. Using log file instead of management interface.
Part has to run as Root (due to Munin most likely not having access to read the log files. Working with the management interface could solve this.Create /usr/local/bin/getVpnUsers.sh:
#!/bin/bash echo "VPN.value `cat /var/log/openvpn-status.log | sed -e '1,/Common Name/d' | sed -e '/ROUTING TABLE/,$d' | wc -l`" > /tmp/.vpn_munin.txt
You can change the name of VPN.value to the VPN name and/or add multiple lines (each with a different NAME.value if you’re running more than one VPN user. Be sure to cat the right log file).



