Merge pull request #13 from phyber/20180501_multi_server_fix

Add status_path label to connected_clients server metric.
This commit is contained in:
Bart Vercoulen authored and GitHub committed 2018-05-11 12:29:38 +02:00
commit 424fa6d1e3
1 file changed
+4 -2
+4 -2
View File
@@ -55,7 +55,8 @@ var (
// Metrics specific to OpenVPN servers.
openvpnConnectedClientsDesc = prometheus.NewDesc(
prometheus.BuildFQName("openvpn", "", "openvpn_server_connected_clients"),
"Number Of Connected Clients", nil, nil)
"Number Of Connected Clients",
[]string{"status_path"}, nil)
openvpnServerHeaders = map[string]OpenvpnServerHeader{
"CLIENT_LIST": {
@@ -248,7 +249,8 @@ func CollectServerStatusFromReader(statusPath string, file io.Reader, ch chan<-
ch <- prometheus.MustNewConstMetric(
openvpnConnectedClientsDesc,
prometheus.GaugeValue,
float64(numberConnectedClient))
float64(numberConnectedClient),
statusPath)
return scanner.Err()
}