Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    OpenVPN doesn't log userid when client disconnects

    Scheduled Pinned Locked Moved OpenVPN
    7 Posts 2 Posters 660 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      skipchang1
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan
        last edited by

        There is a thread in this OpenVPN forum that talks about mailing connected and disconnected users.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • S
          skipchang1
          last edited by

          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.

          GertjanG 1 Reply Last reply Reply Quote 0
          • GertjanG
            Gertjan @skipchang1
            last edited by

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

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            S 3 Replies Last reply Reply Quote 0
            • S
              skipchang1 @Gertjan
              last edited by

              @Gertjan Thank you so much for the link. That was invaluable.

              1 Reply Last reply Reply Quote 0
              • S
                skipchang1 @Gertjan
                last edited by

                @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

                1 Reply Last reply Reply Quote 0
                • S
                  skipchang1 @Gertjan
                  last edited by

                  @Gertjan I figured out the php logging to syslog.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.