On Tue, 13 Feb 2024 13:28:27 -0500, mike tancsa <m...@sentex.net> wrote:
>On 2/13/2024 1:13 PM, Peter Davis via Openvpn-users wrote: >> Hello, >> 1- Is there a way to report when clients connect and disconnect? >> >> 2- Is it possible to notify the connection of a specific client to the >> server through email? >> >On the server, you can use the client-connect/disconnect config. Just >fire whatever script you want from there to do whatever notification you >want. Various environment vars get populated (e.g. X509_0_CN) that you >can save as needed and tune your notifications to match what you need. > >client-connect "/usr/local/etc/openvpn/connect.sh" >client-disconnect "/usr/local/etc/openvpn/disconnect.sh" > I also want to log server side client connect/disconnect events on my server. And I have tried to read the documentation here: https://openvpn.net/community-resources/reference-manual-for-openvpn-2-5/ I can find a lot of entries for the client-connect client-disconnect details, including how it can be configured with call arguments. But what I don't find is any working example of such a script... I have also googled for it but that too fails because noone I have found seems to want to show an actually working setup including: - What needs to be entered in the server.conf file, like permissions - Where the script could reside to be usable - What the script file properties should be - How the script can get the information to write to the log - How it can actually reach a log location and write a file there A working example, which logs client connect and disconnect events with a readable timestamp and some user data into a log file located in say the /etc/openvpn/log directory would be very useful in my opinion. I definitely do NOT want to send any email or such, just log to the file. But the file must never be overwritten such that info disappears. Is there such an example somewhere? -- Bo Berglund Developer in Sweden _______________________________________________ Openvpn-users mailing list Openvpn-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-users