openvpn-monitor icon indicating copy to clipboard operation
openvpn-monitor copied to clipboard

Feature Request — Client History Logs

Open jomsky10 opened this issue 8 years ago • 6 comments

this is not a necessary feature but it would be great if it will be added to openvpn-monitoring since admins of openvpn is not 24/7 online so they can't always trace or see if there are client who shares their account and use it at the same time. :)

image

reference from Chocobozzz :)

jomsky10 avatar Jan 06 '17 14:01 jomsky10

Currently we don't require any storage, and we don't save state anywhere.

This would require a db to store the records, and an external program that constantly polls the management interface for the information (e.g. run by cron).

furlongm avatar Jan 12 '17 06:01 furlongm

+1

csib avatar Jan 12 '17 09:01 csib

+1

zeleanon avatar Apr 17 '18 18:04 zeleanon

+1

aristella avatar Jun 08 '18 07:06 aristella

This can't be done in a robust way from the OpenVPN management interface (which is how openvpn-monitor connects to the server). For starters:

  • OpenVPN only allows a single client connection at a time
  • openvpn-monitor is typically that client
  • openvpn-monitor only runs when you refresh the web page (by default every 5 minutes) -- there are huge opportunities for users to connect, do stuff and disconnect between those 5 minute polls.
  • what happens when 4 admins all have the openvpn-monitor web page open? You'd have a hard time avoiding duplicate log entries.

The far better way is to use OpenVPN's hooks to have it log when users connect/disconnect. It's trivial to write a script that reads env vars and writes them to a log file. Just add that script to OpenVPN's config file as: client-connect /path/to/script client-disconnect /path/to/script

TheAmigo avatar Jun 22 '18 20:06 TheAmigo

This can't be done in a robust way from the OpenVPN management interface (which is how openvpn-monitor connects to the server). For starters:

  • OpenVPN only allows a single client connection at a time
  • openvpn-monitor is typically that client
  • openvpn-monitor only runs when you refresh the web page (by default every 5 minutes) -- there are huge opportunities for users to connect, do stuff and disconnect between those 5 minute polls.
  • what happens when 4 admins all have the openvpn-monitor web page open? You'd have a hard time avoiding duplicate log entries.

The far better way is to use OpenVPN's hooks to have it log when users connect/disconnect. It's trivial to write a script that reads env vars and writes them to a log file. Just add that script to OpenVPN's config file as: client-connect /path/to/script client-disconnect /path/to/script

What should the scripts contain?

katomic avatar May 24 '19 09:05 katomic