• This repository has been archived on 17/Aug/2021
  • Stars
    star
    211
  • Rank 182,402 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Prometheus exporter for OpenVPN.

Prometheus OpenVPN exporter

Please note: This repository is currently unmaintained. Due to insufficient time and not using the exporter anymore we decided to archive this project.


This repository provides code for a simple Prometheus metrics exporter for OpenVPN. Right now it can parse files generated by OpenVPN's --status, having one of the following formats:

  • Client statistics,
  • Server statistics with --status-version 2 (comma delimited),
  • Server statistics with --status-version 3 (tab delimited).

As it is not uncommon to run multiple instances of OpenVPN on a single system (e.g., multiple servers, multiple clients or a mixture of both), this exporter can be configured to scrape and export the status of multiple status files, using the -openvpn.status_paths command line flag. Paths need to be comma separated. Metrics for all status files are exported over TCP port 9176.

Please refer to this utility's main() function for a full list of supported command line flags.

Exposed metrics example

Client statistics

For clients status files, the exporter generates metrics that may look like this:

openvpn_client_auth_read_bytes_total{status_path="..."} 3.08854782e+08
openvpn_client_post_compress_bytes_total{status_path="..."} 4.5446864e+07
openvpn_client_post_decompress_bytes_total{status_path="..."} 2.16965355e+08
openvpn_client_pre_compress_bytes_total{status_path="..."} 4.538819e+07
openvpn_client_pre_decompress_bytes_total{status_path="..."} 1.62596168e+08
openvpn_client_tcp_udp_read_bytes_total{status_path="..."} 2.92806201e+08
openvpn_client_tcp_udp_write_bytes_total{status_path="..."} 1.97558969e+08
openvpn_client_tun_tap_read_bytes_total{status_path="..."} 1.53789941e+08
openvpn_client_tun_tap_write_bytes_total{status_path="..."} 3.08764078e+08
openvpn_status_update_time_seconds{status_path="..."} 1.490092749e+09
openvpn_up{status_path="..."} 1

Server statistics

For server status files (both version 2 and 3), the exporter generates metrics that may look like this:

openvpn_server_client_received_bytes_total{common_name="...",connection_time="...",real_address="...",status_path="...",username="...",virtual_address="..."} 139583
openvpn_server_client_sent_bytes_total{common_name="...",connection_time="...",real_address="...",status_path="...",username="...",virtual_address="..."} 710764
openvpn_server_route_last_reference_time_seconds{common_name="...",real_address="...",status_path="...",virtual_address="..."} 1.493018841e+09
openvpn_status_update_time_seconds{status_path="..."} 1.490089154e+09
openvpn_up{status_path="..."} 1
openvpn_server_connected_clients 1

Usage

Usage of openvpn_exporter:

  -openvpn.status_paths string
    	Paths at which OpenVPN places its status files. (default "examples/client.status,examples/server2.status,examples/server3.status")
  -web.listen-address string
    	Address to listen on for web interface and telemetry. (default ":9176")
  -web.telemetry-path string
    	Path under which to expose metrics. (default "/metrics")
  -ignore.individuals bool
        If ignoring metrics for individuals (default false)

E.g:

openvpn_exporter -openvpn.status_paths /etc/openvpn/openvpn-status.log

Docker

To use with docker you must mount your status file to /etc/openvpn_exporter/server.status.

docker run -p 9176:9176 \
  -v /path/to/openvpn_server.status:/etc/openvpn_exporter/server.status \
  kumina/openvpn-exporter -openvpn.status_paths /etc/openvpn_exporter/server.status

Metrics should be available at http://localhost:9176/metrics.

Get a standalone executable binary

You can download the pre-compiled binaries from the releases page.

More Repositories

1

postfix_exporter

A Prometheus exporter for Postfix.
Go
229
star
2

libvirt_exporter

Prometheus metrics exporter for libvirt.
Go
129
star
3

dovecot_exporter

Prometheus metrics exporter for Dovecot.
Go
51
star
4

nagios-plugins-kumina

A collection of Nagios plugins that we package.
Perl
43
star
5

promacct

Network accounting daemon for Prometheus
C++
34
star
6

fakemac

C
29
star
7

python_container_demo_app

A very simple example of a Python-based web application running in a container.
Python
23
star
8

wsproxy

A websockets proxy, written in C
C
18
star
9

birdwatcher

Birdwatcher: A Prometheus metrics exporter for Calico/BIRD
Python
17
star
10

buckler

A proxy to add support for authentication and authorization to Kibana 4
Python
16
star
11

shutdown-kvm-guests

A script for easily shutting down KVM guests.
Shell
16
star
12

logstash-patterns

A collection of logstash grok patterns we use.
11
star
13

fact-pci_devices

Facts for devices in lspci
Ruby
10
star
14

munin-puppetmaster

Trend a puppetmaster with munin.
Ruby
8
star
15

kubi_ecs_logger

Logging library according to Elastic Common Schema.
Python
5
star
16

k8s-redirectory

Redirectory is a system for redirecting requests that would usually end in a 404 response to a new destination based on rules specified by the user with the help of a UI.
Python
4
star
17

traefik-routing-plugin

Proof of concept. Is it possible to bait Traefik so that we can have a custom solution for figuring out which request needs to go to which k8s service?
Go
4
star
18

kuminami

Our scripts to handle Amazon EC2 instances, the Kumina way.
Shell
4
star
19

checkpuppet

A script that allows us to restart puppet from puppet. It also makes sure puppet runs.
Shell
3
star
20

awssyncer

Automatic syncer of local directories into Amazon AWS S3
C++
3
star
21

redirectory

A simple app to easily create redirects.
Python
2
star
22

ndproxy

A script to push NDs from one interface to another
Shell
2
star
23

django-powerdns-manager

This is an import of the django-powerdns-admin mercurial repository, with changes
Python
1
star
24

vagrant-buckler

A Vagrant environment for testing Buckler
Ruby
1
star