Koozali.org: home of the SME Server

Automated alert email for vpn connection

Offline dede77b

  • **
  • 29
  • +0/-0
Automated alert email for vpn connection
« on: May 28, 2009, 03:50:21 PM »
I'm looking for a solution to be informed via email everytime a vpn connection become active.

In sme7admin I can set a value for the Maximum number of vpn sessions, that means I can just receive an email when I have 2 vpn connection up at a time.

Have you any suggestion for this?

I'm using openvpn as a bridge.

Thanks
Fred

Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: Automated alert email for vpn connection
« Reply #1 on: May 28, 2009, 04:21:48 PM »
Hi
sme7admin won't alert you for OpenVPN connections, only the builtin PPTP.
If you want to have an email each time a client connects, it's quite easy. Create a custom-template for the config file /etc/openvpn/bridge/openvpn.conf and add a --client-connect directive which call a simple script, which will send the mail. man openvpn for more informations on this directive. You can even send who is connecting and from where using some environment variables. You can also do the same for --client-disconnect to have an email sent when clients disconnect.

Cheers, Daniel
C'est la fin du monde !!! :lol:

Offline dede77b

  • **
  • 29
  • +0/-0
Re: Automated alert email for vpn connection
« Reply #2 on: May 29, 2009, 05:54:43 PM »
Tnx for your suggestion. I will work on this and see what I can do.

Fred