Missed clients

12 views
Skip to first unread message

Metrics Searcher

unread,
Jun 15, 2020, 11:46:23 AM6/15/20
to Prometheus Users
Hello.

Could you please give me a clue how to find lost clients from the OpenVPN server. The metric looks like below:
openvpn_server_client_received_bytes_total{common_name="ID",connection_time="1591021598",instance="server.com:9176",job="server.com",real_address="1.1.1.1:56228",status_path="/etc/openvpn/openvpn-status.log",username="ID",virtual_address="IP"}

I'd like to get all clients which doesn't any update during an hour or a day. I suppose I should to use something like "absent_over_time", but as I understand it works only by a job of instance, not with the metric.

Julien Pivotto

unread,
Jun 15, 2020, 11:49:14 AM6/15/20
to Metrics Searcher, Prometheus Users
On 15 Jun 08:46, 'Metrics Searcher' via Prometheus Users wrote:
> Hello.
>
> Could you please give me a clue how to find lost clients from the OpenVPN
> server. The metric looks like below:
> openvpn_server_client_received_bytes_total{common_name="ID",connection_time="1591021598",instance="server.com:9176",job="server.com",real_address="1.1.1.1:56228",status_path="/etc/openvpn/openvpn-status.log",username="ID",virtual_address="IP"}

While it is not advised to put so much details in metrics labels, here
is how you could do that:

rate(openvpn_server_client_received_bytes_total[1d]) == 0
or
(
openvpn_server_client_received_bytes_total offset 1d unless
openvpn_server_client_received_bytes_total
)

>
> I'd like to get all clients which doesn't any update during an hour or a
> day. I suppose I should to use something like "absent_over_time", but as I
> understand it works only by a job of instance, not with the metric.
>
> --
> You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/c2106059-0db9-4a50-8c2e-6077f8364bd4o%40googlegroups.com.


--
Julien Pivotto
@roidelapluie
Reply all
Reply to author
Forward
0 new messages