OPNsense Forum

English Forums => Hardware and Performance => Topic started by: hnupsant on January 20, 2025, 10:11:52 AM

Title: How to Set Up Status Logs for Monitoring VPN Client Status with OpenVPN Instanc
Post by: hnupsant on January 20, 2025, 10:11:52 AM
Hi everyone,

We are currently using OPNsense and have successfully configured status logs to be sent to Prometheus for monitoring our VPN client status through an OpenVPN server. We are tracking key metrics such as traffic throughput, client state (up/down), last connection time, session duration, etc.

Now, we are in the process of migrating from an OpenVPN server to the OpenVPN instance in OPNsense. However, we are unsure of the best way to set up the status log feature on the OpenVPN instance to continue monitoring similar client status metrics.

Can anyone provide guidance on how to configure status logs for OpenVPN instance in OPNsense, specifically for:

VPN client traffic
Client state (up/down)
Time of last connection
Session duration
Any help or pointers to documentation would be greatly appreciated!

Thanks in advance!
Title: Re: How to Set Up Status Logs for Monitoring VPN Client Status with OpenVPN Instanc
Post by: Monviech (Cedrik) on January 20, 2025, 12:15:20 PM
You can look at the REST API the dashboard OpenVPN widgets use.

https://github.com/opnsense/core/blob/14bdcc9d3d76a62c3c82929825f1b53a7cf73124/src/opnsense/www/js/widgets/OpenVPNClients.js#L63