OpenVPN
Bleemeo monitors the OpenVPN server through automatic service detection and optional detailed metrics collection via a Prometheus exporter.
Auto-Detection
Section titled “Auto-Detection”Glouton automatically detects OpenVPN instances running on the host.
| Metric | Description |
|---|---|
service_status | Status of OpenVPN |
Exporter Metrics
Section titled “Exporter Metrics”Detailed OpenVPN metrics are collected using the third-party openvpn-exporter.
Prerequisites
Section titled “Prerequisites”- OpenVPN server installed and running
- Glouton agent installed on the same host
- Access to the OpenVPN status log file
Service Configuration
Section titled “Service Configuration”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.logRestart OpenVPN to apply the change if needed:
sudo systemctl restart openvpn@serverInstalling the Exporter
Section titled “Installing the Exporter”Download the latest release from the openvpn-exporter releases page, or install with Go:
go install github.com/natrontech/openvpn-exporter@latestStart the exporter, pointing it to the OpenVPN status file:
openvpn-exporter --status-file /var/log/openvpn/openvpn-status.logThe exporter listens on port 9176 by default. Verify it is working:
curl http://localhost:9176/metricsFor production use, create a systemd service unit to manage the exporter process.
Glouton Configuration
Section titled “Glouton Configuration”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"EOFCreate or edit C:\ProgramData\glouton\conf.d\99-openvpn.conf:
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"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 |