Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request — Client History Logs #27

Open
jomsky10 opened this issue Jan 6, 2017 · 6 comments
Open

Feature Request — Client History Logs #27

jomsky10 opened this issue Jan 6, 2017 · 6 comments

Comments

@jomsky10
Copy link

jomsky10 commented Jan 6, 2017

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
:)

@furlongm
Copy link
Owner

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).

@csib
Copy link

csib commented Jan 12, 2017

+1

2 similar comments
@zeleanon
Copy link

+1

@aristella
Copy link

+1

@TheAmigo
Copy link

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

@katomic
Copy link

katomic commented May 24, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants