D
D
Dmitriy Loginov2020-04-16 21:29:43
openvpn
Dmitriy Loginov, 2020-04-16 21:29:43

How to find out the connection duration of users in openVPN?

In the era of total remoteness, the task was set to record the time when users connect to the OpenVPN server. The server itself is on FreeBSD without any web snouts and other statistics.
There is a status log file like
ivanov.as,IP_addres,56924339,46404603,Thu Apr 16 07:20:32
2020
,1000952454,Thu Apr 16 08:08:04 2020

Can I parse it by users and write it to a separate log? Are there any other options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Radjah, 2020-04-17
@Radjah

It is possible through the management console ("status 2" command) to get a list of connected users (lines with CLIENT_LIST) and select time from the record in the unit timestamp format ("Connected Since (time_t)" field is the 9th in the list). And then do the accounting of time in a convenient way.
But for this, a line must be written in the server config
management адрес порт
. The script for polling can be run through cron or some kind of daemon to constantly keep connections to the server console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question