Skip to content

OpenVPN

Auto-Detection
Exporter Metrics

Bleemeo monitors the OpenVPN server through automatic service detection and optional detailed metrics collection via a Prometheus exporter.

Glouton automatically detects OpenVPN instances running on the host.

Metric Description
service_status Status of OpenVPN

Detailed OpenVPN metrics are collected using the third-party openvpn-exporter.

  • OpenVPN server installed and running
  • Glouton agent installed on the same host
  • Access to the OpenVPN status log file

Ensure the OpenVPN status log is being written. This is usually configured in your OpenVPN server configuration (e.g., /etc/openvpn/server.conf):

status /var/log/openvpn/openvpn-status.log

Restart OpenVPN to apply the change if needed:

Terminal window
sudo systemctl restart openvpn@server

Download the latest release from the openvpn-exporter releases page, or install with Go:

Terminal window
go install github.com/natrontech/openvpn-exporter@latest

Start the exporter, pointing it to the OpenVPN status file:

Terminal window
openvpn-exporter --status-file /var/log/openvpn/openvpn-status.log

The exporter listens on port 9176 by default. Verify it is working:

Terminal window
curl http://localhost:9176/metrics

For production use, create a systemd service unit to manage the exporter process.

Terminal window
sudo tee /etc/glouton/conf.d/99-openvpn.conf > /dev/null << 'EOF'
metric:
prometheus:
targets:
- url: "http://localhost:9176/metrics"
name: "openvpn"
allow_metrics:
- "openvpn_server_connected_clients"
- "openvpn_server_bytes_received_total"
- "openvpn_server_bytes_sent_total"
- "openvpn_client_bytes_received"
- "openvpn_client_bytes_sent"
- "openvpn_client_connected_since"
- "openvpn_up"
EOF

Glouton automatically detects configuration changes.

Metric Description
openvpn_up Whether the OpenVPN status file is readable (1 = up)
openvpn_server_connected_clients Number of currently connected VPN clients
openvpn_server_bytes_received_total Total bytes received by the server from all clients
openvpn_server_bytes_sent_total Total bytes sent by the server to all clients
openvpn_client_bytes_received Bytes received from a specific client
openvpn_client_bytes_sent Bytes sent to a specific client
openvpn_client_connected_since Unix timestamp when the client connected