mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-23 17:32:57 +02:00
openvpn: Add metrics script
This script is called when an OpenVPN Roadwarrior client connects or disconnect and logs the start and duration of the session. This can be used to monitor session duration and data transfer. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
f81fe76354
commit
708f2b7368
@@ -372,6 +372,11 @@ sub writeserverconf {
|
||||
} else {
|
||||
print CONF "verb 3\n";
|
||||
}
|
||||
|
||||
print CONF "# Log clients connecting/disconnecting\n";
|
||||
print CONF "client-connect \"/usr/sbin/openvpn-metrics client-connect\"\n";
|
||||
print CONF "client-disconnect \"/usr/sbin/openvpn-metrics client-disconnect\"\n";
|
||||
|
||||
# Print server.conf.local if entries exist to server.conf
|
||||
if ( !-z $local_serverconf && $sovpnsettings{'ADDITIONAL_CONFIGS'} eq 'on') {
|
||||
open (LSC, "$local_serverconf");
|
||||
|
||||
Reference in New Issue
Block a user