OpenVPN - Showing connected users IP Address

Hello Community,

I´ve integrated my Grafana with Zabbix. And Zabbix with OpenVPN. So right now i can view the network traffic, and how many users are connected.

But now, i want to gow beyond. My company has a request to show on Grafana the IP Address that is currently connected. I know how to do the command line in Linux, like for i.e.:

UserParameter=num_user.openvpn, cat /var/log/openvpn-server.status | sed -n ‘/Connected Since/,/ROUTING/p’ | grep -o ‘[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}’

But the listed IP´s from the command above i cannot show them in grafana. Is there any way to do this ?

If you’ve got a reverse proxy in front of Grafana, you could collect the access logs of the reverse proxy and do a query to SELECT the DISTINCT ip addresses that accessed urls of the Grafana server.

Another idea would be to make or configure an existing collect plugin to execute the command you wrote or it’S equivalent in another language and store the result in the database you use.