|
1 |
| -# openvpn_exporter |
| 1 | +# openvpn_exporter |
| 2 | + |
| 3 | +[](https://github.com/patrickjahns/openvpn_exporter/releases) |
| 4 | +[](https://github.com/patrickjahns/openvpn_exporter/blob/master/LICENSE) |
| 5 | +[](https://github.com/patrickjahns/openvpn_exporter/actions?query=workflow%3A%22Test+and+Build%22) |
| 6 | +[](https://pkg.go.dev/github.com/patrickjahns/openvpn_exporter) |
| 7 | +[](https://goreportcard.com/report/github.com/patrickjahns/openvpn_exporter) |
| 8 | + |
| 9 | +Prometheus exporter for openvpn. Exposes the metrics from [openvpn status file](https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/) - currently supports format version 1 |
| 10 | + |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +For pre built binaries, please take a look at the [github releases](https://github.com/patrickjahns/openvpn_exporter/releases) |
| 15 | + |
| 16 | +## Usage |
| 17 | + |
| 18 | +### Example metrics |
| 19 | + |
| 20 | +``` |
| 21 | +# HELP openvpn_build_info A metric with a constant '1' value labeled by version information |
| 22 | +# TYPE openvpn_build_info gauge |
| 23 | +openvpn_build_info{date="20200425",go="go1.14.2",revision="90ee059",version="90ee059"} 1 |
| 24 | +# HELP openvpn_bytes_received Amount of data received via the connection |
| 25 | +# TYPE openvpn_bytes_received gauge |
| 26 | +openvpn_bytes_received{common_name="user1",server="local"} 7.883858e+06 |
| 27 | +openvpn_bytes_received{common_name="user2",server="local"} 1.6732e+06 |
| 28 | +openvpn_bytes_received{common_name="[email protected]",server="local"} 1.9602844e+07 |
| 29 | +openvpn_bytes_received{common_name="user4",server="local"} 582207 |
| 30 | +# HELP openvpn_bytes_sent Amount of data sent via the connection |
| 31 | +# TYPE openvpn_bytes_sent gauge |
| 32 | +openvpn_bytes_sent{common_name="user1",server="local"} 7.76234e+06 |
| 33 | +openvpn_bytes_sent{common_name="user2",server="local"} 2.065632e+06 |
| 34 | +openvpn_bytes_sent{common_name="[email protected]",server="local"} 2.3599532e+07 |
| 35 | +openvpn_bytes_sent{common_name="user4",server="local"} 575193 |
| 36 | +# HELP openvpn_connected_since Unixtimestamp when the connection was established |
| 37 | +# TYPE openvpn_connected_since gauge |
| 38 | +openvpn_connected_since{common_name="user1",server="local"} 1.587551802e+09 |
| 39 | +openvpn_connected_since{common_name="user2",server="local"} 1.587551812e+09 |
| 40 | +openvpn_connected_since{common_name="[email protected]",server="local"} 1.587552165e+09 |
| 41 | +openvpn_connected_since{common_name="user4",server="local"} 1.587551814e+09 |
| 42 | +# HELP openvpn_connections Amount of currently connected clients |
| 43 | +# TYPE openvpn_connections gauge |
| 44 | +openvpn_connections{server="local"} 4 |
| 45 | +# HELP openvpn_last_updated Unix timestamp when the last time the status was updated |
| 46 | +# TYPE openvpn_last_updated gauge |
| 47 | +openvpn_last_updated{server="local"} 1.587665671e+09 |
| 48 | +# HELP openvpn_max_bcast_mcast_queue_len MaxBcastMcastQueueLen of the server |
| 49 | +# TYPE openvpn_max_bcast_mcast_queue_len gauge |
| 50 | +openvpn_max_bcast_mcast_queue_len{server="local"} 5 |
| 51 | +# HELP openvpn_start_time Unix timestamp of the start time |
| 52 | +# TYPE openvpn_start_time gauge |
| 53 | +openvpn_start_time 1.587931295e+09 |
| 54 | +``` |
| 55 | + |
| 56 | +## Development |
| 57 | + |
| 58 | +This project requires Go >= v1.14. To get started, clone the repository and run `make generate` |
| 59 | + |
| 60 | +```shell script |
| 61 | +git clone https://github.com/patrickjahns/openvpn_exporter.git |
| 62 | +cd openvpn_exporter |
| 63 | + |
| 64 | +make generate |
| 65 | +make build |
| 66 | + |
| 67 | +./cmd/openvpn_exporter -h |
| 68 | +``` |
| 69 | + |
| 70 | +### Building the project |
| 71 | + |
| 72 | +```shell script |
| 73 | +make build |
| 74 | +``` |
| 75 | + |
| 76 | +### Running tests |
| 77 | + |
| 78 | +```shell script |
| 79 | +make test |
| 80 | +``` |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
0 commit comments