OpenVPN doesn't log userid when client disconnects
-
With verbose level 2, when a client connects, the user ID is logged. However, when they disconnect, their user ID is not logged. Is there a way to make the system log the user ID on disconnect?
-
There is a thread in this OpenVPN forum that talks about mailing connected and disconnected users.
-
I have a script that analyzes the openvpn.log file to create a report that says which user connected when. I need to know when that user disconnected in the report too. Generating an email is not gonna help. I guess I can look at using an external trigger script to log the user ID. I was hoping to find a way for openvpn to log that info.
-
@skipchang1 said in OpenVPN doesn't log userid when client disconnects:
Generating an email is not gonna help
See here : https://forum.netgate.com/topic/151351/email-notification-openvpn-client-connect-common-name/53?_=1605885378780
Remove the
notify_all_remote($local_connect_value);
line.
Have the $local_connect_value (line) logged.Now, whith what ever tool you like you can parse the log file.
There will be 'connect' and 'disconnect' lines for every connected OpenVPN client. -
@Gertjan Thank you so much for the link. That was invaluable.
-
@Gertjan One more dumb question. I removed the "notify_all_remote" line from the php script.
I'm a newbie with php. How do I add a logline to the openvpn logging?
Thanks,
Skip -
@Gertjan I figured out the php logging to syslog.