Skip to content

Instantly share code, notes, and snippets.

@th-schwarz
Created October 26, 2021 09:27
Show Gist options
  • Save th-schwarz/f85c5375dde464b8375445cd17e1c856 to your computer and use it in GitHub Desktop.
Save th-schwarz/f85c5375dde464b8375445cd17e1c856 to your computer and use it in GitHub Desktop.
munin plugin to count openvpn users
#!/bin/bash
if [ "$1" = "config" ]; then
echo 'graph_title OpenVPN - count of users'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel count of users'
echo 'graph_category network'
echo 'graph_scale no'
echo 'run.label users'
exit 0
fi
USERCOUNT=$( sed -e '/ROUTING TABLE/Q' /var/log/openvpn/openvpn-status.log | tail -n +4 | wc -l )
printf "run.value %s\n" $USERCOUNT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment