Skip to content

Commit 18c48d2

Browse files
authored
Merge pull request #2 from patrickjahns/doc
Add more README information
2 parents 3b236a6 + e2c28ce commit 18c48d2

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ fmt:
5353
vet:
5454
$(GO) vet $(PACKAGES)
5555

56+
.PHONY: generate
57+
generate:
58+
$(GO) generate $(GENERATE)
59+
5660
.PHONY: lint
5761
lint:
5862
@which golint > /dev/null; if [ $$? -ne 0 ]; then \

README.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,85 @@
1-
# openvpn_exporter
1+
# openvpn_exporter
2+
3+
[![Release](https://img.shields.io/github/v/release/patrickjahns/openvpn_exporter?sort=semver)](https://github.com/patrickjahns/openvpn_exporter/releases)
4+
[![LICENSE](https://img.shields.io/github/license/patrickjahns/openvpn_exporter)](https://github.com/patrickjahns/openvpn_exporter/blob/master/LICENSE)
5+
[![Test and Build](https://github.com/patrickjahns/openvpn_exporter/workflows/Test%20and%20Build/badge.svg)](https://github.com/patrickjahns/openvpn_exporter/actions?query=workflow%3A%22Test+and+Build%22)
6+
[![Go Doc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/patrickjahns/openvpn_exporter)
7+
[![Go Report Card](https://goreportcard.com/badge/github.com/patrickjahns/openvpn_exporter)](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

Comments
 (0)