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

    Email Notification - OpenVPN Client Connect (Common Name)

    Scheduled Pinned Locked Moved OpenVPN
    138 Posts 20 Posters 44.1k 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
      Stewart @Gertjan
      last edited by

      @gertjan

      I'm using different scripts for each event but tried it with the same script to rule it out.

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

        Progress! I've found that if I add
        explicit-exit-notify
        to the client then it populates immediately. I guess that without it then it's waiting for a timeout period before it disconnects the session.

        Since we have a lot of clients out there already, is there a way to add this to the VPN server config? Or does it have to be manually entered into every client? I've tried adding into the server Custom Options but it doesn't work.

        GertjanG JeGrJ 2 Replies Last reply Reply Quote 0
        • GertjanG
          Gertjan @Stewart
          last edited by

          @stewart said in Email Notification - OpenVPN Client Connect (Common Name):

          Progress! I've found that if I add
          explicit-exit-notify
          to the client then it populates immediately.

          Client ?
          These are OpenVPN server 'custom' command options.
          At least, they are in the context of this forum thread.
          You can see the doc here : https://build.openvpn.net/man/openvpn-2.5/openvpn.8.html

          You are using OpenVPN 2.5.x, right ? And UDP tunnnels ?

          @stewart said in Email Notification - OpenVPN Client Connect (Common Name):

          I've tried adding into the server Custom Options but it doesn't work.

          As above, see again :

          895edba3-c141-4997-9730-f656f7b80141-image.png

          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
          • JeGrJ
            JeGr LAYER 8 Moderator @Stewart
            last edited by

            @stewart said in Email Notification - OpenVPN Client Connect (Common Name):

            Progress! I've found that if I add
            explicit-exit-notify
            to the client then it populates immediately. I guess that without it then it's waiting for a timeout period before it disconnects the session.

            It is. For UDP clients you have to wait your configured timeout period (normally ~60-90s) for the disconnect script to get executed as the server doesn't see the client disconnecting. Explicit-exit-notify on the client fixes that by alerting the server of the clients disconnect wish.

            Don't forget to upvote 👍 those who kindly offered their time and brainpower to help you!

            If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

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

              @jegr Aha !! I get it.
              I was disconnecting manually my client, by sliding the on/off button in the client while testing.
              That probably makes the sending a "connection down" to the server, so there were no delays for me doing such a test.

              When the client looses the connection because of bad data reception (Wifi or data carrier like 4G5G) then the server would apply a wait period before it fires a "client-disconnect" cmd.

              @JeGr Thanks for making that clear.

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

              JeGrJ 1 Reply Last reply Reply Quote 0
              • JeGrJ
                JeGr LAYER 8 Moderator @Gertjan
                last edited by

                @gertjan said in Email Notification - OpenVPN Client Connect (Common Name):

                I was disconnecting manually my client, by sliding the on/off button in the client while testing.

                Yes, but without explicit-exit-notify UDP clients don't inform the server of their disconnect. So the server just stops getting traffic, waits for the tiemeout/keepalive time and then internally de-registers the client as unavailable/disconnected and runs the script.
                TCP clients don't have that problem because of TCP (d'uh! ;)) and explicit-exit-notify brings that to UDP - but with its own problems (e.g. mixed style multi-configs with udp&tcp remote statements for automatic fallback etc. aren't possible ATM).

                As I did a bit of an updated version of that script for noplan, I tested around that myself and could see that behavior every time. One just has to be patient :)

                Cheers
                \jens

                Don't forget to upvote 👍 those who kindly offered their time and brainpower to help you!

                If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

                GertjanG S 2 Replies Last reply Reply Quote 0
                • GertjanG
                  Gertjan @JeGr
                  last edited by

                  @jegr said in Email Notification - OpenVPN Client Connect (Common Name):

                  Yes, but without explicit-exit-notify UDP clients don't inform the server of their disconnect

                  See above what I have in the custom options.
                  My connection plain vanilla : is UDP based, port 1194 etc.

                  I connect, I wait 20+ seconds, and then I slide the connection connection on my iPhone - OpenVPN Connect App to off, I see this line immediately in the pfSense OpenVPN server log :

                  f8a8ac00-8802-4c22-8dcf-c195bdf4ca36-image.png

                  You can clearly see the 25 seconds delay.

                  gmail also notifies me immediately on both events.

                  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
                    Stewart @JeGr
                    last edited by

                    @jegr said in Email Notification - OpenVPN Client Connect (Common Name):

                    @gertjan said in Email Notification - OpenVPN Client Connect (Common Name):

                    I was disconnecting manually my client, by sliding the on/off button in the client while testing.

                    Yes, but without explicit-exit-notify UDP clients don't inform the server of their disconnect. So the server just stops getting traffic, waits for the tiemeout/keepalive time and then internally de-registers the client as unavailable/disconnected and runs the script.
                    TCP clients don't have that problem because of TCP (d'uh! ;)) and explicit-exit-notify brings that to UDP - but with its own problems (e.g. mixed style multi-configs with udp&tcp remote statements for automatic fallback etc. aren't possible ATM).

                    As I did a bit of an updated version of that script for noplan, I tested around that myself and could see that behavior every time. One just has to be patient :)

                    Cheers
                    \jens

                    My problem with being patient is that while waiting no other script will launch. So if someone connects or disconnects within that 90 second window (or whatever that window may be) the scripts don't launch. At least, that's what it appears is happening. I don't see a reason why it would be that way, though.

                    noplanN 1 Reply Last reply Reply Quote 0
                    • noplanN
                      noplan @Stewart
                      last edited by

                      @stewart said in Email Notification - OpenVPN Client Connect (Common Name):

                      while waiting no other script will launch. So if someone connects or disconnects within that 90 second window (or whatever that window may be) the scripts don't launch.

                      r u sure ?
                      cuz we don't see it ... have tested after reading your post ... can't confirm it.
                      brNP

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        Stewart @noplan
                        last edited by

                        @noplan said in Email Notification - OpenVPN Client Connect (Common Name):

                        @stewart said in Email Notification - OpenVPN Client Connect (Common Name):

                        while waiting no other script will launch. So if someone connects or disconnects within that 90 second window (or whatever that window may be) the scripts don't launch.

                        r u sure ?
                        cuz we don't see it ... have tested after reading your post ... can't confirm it.
                        brNP

                        Maybe it's because I'm using the same user over and over to test? When I connect the first time the log gets generated (I have the script writing to a log file instead of emailing). After that, I can connect and disconnect and no other lines are written to the log file. Not even the first disconnect gets written. If I wait until after the disconnect line gets written then I can connect and the line gets logged.

                        noplanN ArmstrongA 2 Replies Last reply Reply Quote 0
                        • noplanN
                          noplan @Stewart
                          last edited by

                          @stewart

                          sounds interesting

                          a) use a 2nd user
                          b) connect with user 1
                          c) connect with user 2 when user 1 is connected
                          d) disconnect user 1
                          e) shortly after done d) disconnect user 2

                          both users are written in your file ?

                          be so kind and show us logFile and script
                          brNP

                          S 1 Reply Last reply Reply Quote 0
                          • ArmstrongA
                            Armstrong @Stewart
                            last edited by

                            @stewart

                            Are you perhaps experiencing the same thing I was in this post https://forum.netgate.com/post/897352 ?

                            The disconnect lags well behind the actual disconnection.

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              Stewart @noplan
                              last edited by

                              @noplan said in Email Notification - OpenVPN Client Connect (Common Name):

                              @stewart

                              sounds interesting

                              a) use a 2nd user
                              b) connect with user 1
                              c) connect with user 2 when user 1 is connected
                              d) disconnect user 1
                              e) shortly after done d) disconnect user 2

                              both users are written in your file ?

                              be so kind and show us logFile and script
                              brNP

                              I'll get a second pc up and running to test with. It'll take a few.

                              S 1 Reply Last reply Reply Quote 0
                              • S
                                Stewart @Armstrong
                                last edited by

                                @armstrong said in Email Notification - OpenVPN Client Connect (Common Name):

                                @stewart

                                Are you perhaps experiencing the same thing I was in this post https://forum.netgate.com/post/897352 ?

                                The disconnect lags well behind the actual disconnection.

                                Yes and no. Yes, I'm experiencing it and it can be resolved by adding explicit-exit-notify to the client. No, in that the issue I'm dealing with is that during that delay it seems like no scripts are running.

                                noplanN 1 Reply Last reply Reply Quote 0
                                • noplanN
                                  noplan @Stewart
                                  last edited by

                                  for me this whole case is pretty interesting
                                  because we're using this script like a ton of admins too to get information on the openVPN usage
                                  and noOne except @JeGr (as always 🤡 ) was looking for

                                  but without explicit-exit-notify UDP clients don't inform the server of their disconnect

                                  so plz keep us posted with all the details you got
                                  NP

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

                                    @stewart said in Email Notification - OpenVPN Client Connect (Common Name):

                                    @noplan said in Email Notification - OpenVPN Client Connect (Common Name):

                                    @stewart

                                    sounds interesting

                                    a) use a 2nd user
                                    b) connect with user 1
                                    c) connect with user 2 when user 1 is connected
                                    d) disconnect user 1
                                    e) shortly after done d) disconnect user 2

                                    both users are written in your file ?

                                    be so kind and show us logFile and script
                                    brNP

                                    I'll get a second pc up and running to test with. It'll take a few.

                                    I can confirm that the logging only affects that account. I simulated with a second PC. Had it connect and then disconnect. While waiting, I had the first machine connect and disconnect. It shows all of the logs as expected. It seems the lack of processing is limited to that one account.

                                    noplanN 1 Reply Last reply Reply Quote 0
                                    • noplanN
                                      noplan @Stewart
                                      last edited by

                                      @stewart

                                      strange...

                                      But good news for us that everything is works as expected

                                      1 Reply Last reply Reply Quote 0
                                      • viktor_gV
                                        viktor_g Netgate
                                        last edited by

                                        You can create a feature request for this:
                                        https://docs.netgate.com/pfsense/en/latest/development/feature-requests.html

                                        noplanN 1 Reply Last reply Reply Quote 0
                                        • noplanN
                                          noplan @viktor_g
                                          last edited by

                                          @viktor_g said in Email Notification - OpenVPN Client Connect (Common Name):

                                          You can create a feature request for this:

                                          for what ?
                                          the eMail notification ?

                                          yes notification would be cool, but cooler but not job of the firewall
                                          would be a reporting tool with output like in post#76

                                          anyhow reading this from top to bottom
                                          usin search function of this forum there will pop up a pretty professional tool
                                          based on this a lot of people are using to get information about their openVPN connections
                                          especially when you have to monitor contractors and other folks gettin access to your network

                                          or am i gettin it wrong ?

                                          br NP

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            Stewart @noplan
                                            last edited by Stewart

                                            @noplan

                                            I wanted to update on what I've created so far. I hope this all comes through properly. There is still experimental stuff in there as I figure it out and the code is sloppy in some places (especially as I hacked in the stuff to make it blend in to the pfSense theming) but the basic stuff is all there.

                                            connect.sh

                                            #!/usr/local/bin/php -q
                                            
                                            <?php
                                            //      Gather Info
                                                    $date = date('F j, Y');
                                                    $time = date('g:i a');
                                                    require_once("/etc/inc/notices.inc");
                                            
                                            //      Compile Info String to Send
                                                    $local_connect_value = "USER: " . getenv('common_name') . "; CONNECTED; CONNECTED ON: " . $date . "; at " .$time . "; IP CONNECTED FROM: " . getenv('trusted_ip') . " INTERNAL IP ASSIGNED: " . getenv('ifconfig_pool_remote_ip') . "\n";
                                            
                                            //      Send Email Notification of Event
                                            //      notify_all_remote($local_connect_value);
                                            
                                            $filename="/var/log/OpenVPN_Users.log";
                                            $fp = fopen($filename, 'a');
                                            fwrite($fp,$local_connect_value);
                                            fclose($fp);
                                            
                                            ?>
                                            
                                            

                                            disconnect.sh

                                            #!/usr/local/bin/php -q
                                            <?php
                                            //      Gather Info
                                                    require_once("/etc/inc/notices.inc");
                                            //      $date = date('F j, Y, g:i a');
                                                    $date = date('F j, Y');
                                                    $time = date('g:i a');
                                                    $durationSeconds = getenv('time_duration');
                                            
                                            //      Function to calculate time from seconds to human readable format
                                                    function seconds2human($ss) {
                                                            $s = $ss%60;
                                                            $m = floor(($ss%3600)/60);
                                                            $h = floor(($ss%86400)/3600);
                                                            $d = floor(($ss%2592000)/86400);
                                                            $M = floor($ss/2592000);
                                                            return "$d days $h hours $m minutes $s seconds";
                                                    }
                                            
                                            //      Compile Info String to Send
                                                    $local_connect_value .= "USER: " . getenv('common_name') . "; DISCONNECTED; DISCONNECTED ON: " . $date . "; at " . $time . "; DURATION: " . $durationSeconds . " seconds or " . seconds2human($durationSeconds) . " DATA UPLOADED (RECEIVED): " . round(((getenv('bytes_received'))/1048576),2) . " MB DATA DOWNLOADED (SENT): " . round(((getenv('bytes_sent'))/1048576),2) ." MB\n";
                                            
                                            //      Send Email Notification of Event
                                            //      notify_all_remote($local_connect_value);
                                            
                                            
                                            //      Output to Log File
                                                    $filename="/var/log/OpenVPN_Users.log";
                                                    $fp = fopen($filename, 'a');
                                                    fwrite($fp,$local_connect_value);
                                                    fclose($fp);
                                            
                                            ?>
                                            
                                            
                                            

                                            OpenVPNUsers.log

                                            USER: LTest; CONNECTED; CONNECTED ON: September 15, 2021; at 3:32 pm; IP CONNECTED FROM: 111.111.111.111 INTERNAL IP ASSIGNED: 10.0.100.2
                                            USER: LTest; DISCONNECTED; DISCONNECTED ON: September 15, 2021; at 3:32 pm; DURATION: 17 seconds or 0 days 0 hours 0 minutes 17 seconds DATA UPLOADED (RECEIVED): 0.28 MB DATA DOWNLOADED (SENT): 0.17 MB
                                            
                                            

                                            /usr/local/www/vpn_openvpn_userlogging.php

                                            <?php
                                            /*
                                             * vpn_openvpn_userlogging.php
                                             *
                                             * Sept 2021
                                             */
                                            
                                            ##|+PRIV
                                            ##|*IDENT=page-openvpn-userlogging
                                            ##|*NAME=OpenVPN: User Logging
                                            ##|*DESCR=View OpenVPN User Connections.
                                            ##|*MATCH=vpn_openvpn_userlogging.php*
                                            ##|-PRIV
                                            
                                            require_once("guiconfig.inc");
                                            require_once("openvpn.inc");
                                            require_once("pfsense-utils.inc");
                                            require_once("pkg-utils.inc");
                                            
                                            global $openvpn_topologies, $openvpn_tls_modes;
                                            
                                            $shortcut_section = "openvpn";
                                            include("head.inc");
                                            
                                            
                                            
                                            $tab_array = array();
                                            $tab_array[] = array(gettext("Servers"), false, "vpn_openvpn_server.php");
                                            $tab_array[] = array(gettext("Clients"), true, "vpn_openvpn_client.php");
                                            $tab_array[] = array(gettext("Client Specific Overrides"), false, "vpn_openvpn_csc.php");
                                            $tab_array[] = array(gettext("Wizards"), false, "wizard.php?xml=openvpn_wizard.xml");
                                            add_package_tabs("OpenVPN", $tab_array);
                                            display_top_tabs($tab_array);
                                            
                                            
                                            
                                            // Function to calculate time from seconds to human readable format
                                            function seconds2human($ss) {
                                                    $s = $ss%60;
                                                    $m = floor(($ss%3600)/60);
                                                    $h = floor(($ss%86400)/3600);
                                                    $d = floor(($ss%2592000)/86400);
                                                    $M = floor($ss/2592000);
                                                    return "$d days $h hours $m minutes $s seconds";
                                            }
                                            
                                            //Variables
                                            $logFilename = '/var/log/OpenVPN_Users.log';            //Log to be read in to generate information from
                                            $userFilename = '/tmp/OpenVPN_UniqueUsers.log';         //Scratchpad that stores usernames that then get read back into an array
                                            $nameSelected = $_POST["user_selected"];                //Receive the user selected and filter based on it
                                            $secondsCounter = 0;                                    //Running Tally of Time
                                            $dataUploadedTotal = 0;                                 //Running Tally of Data Uploaded
                                            $dataDownloadedTotal = 0;                               //Running Tally of Data Downloaded
                                            
                                            //Delete the $userFilename log so it can be filled fresh with each run
                                            unlink($userFilename);
                                            ?>
                                            
                                            
                                            <body>
                                            
                                            
                                            <div class="panel panel-default">
                                            
                                                    <div class="panel-heading"><h2 class="panel-title"><?=gettext('Client Connections')?>
                                            <?php
                                                    if ($nameSelected !== "" && $nameSelected !== "Choose one"){
                                                            echo "<br />".'User Selected='.$nameSelected;
                                                    }
                                            ?>
                                                    </h2></div>
                                                    <div class="table-responsive">
                                                    <table id="tblResults" class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
                                            
                                                            <thead><tr><th width=8%>USER</th><th width=12%>EVENT</th><th width=13%>EVENT DATE</th><th width=7%>EVENT TIME</th><th width=60%>INFORMATION</th></tr></thead><tbody>
                                            
                                                            <?php
                                                            $dataArray = [];                                              // The nested array to hold all the arrays
                                                            if (($h = fopen("{$logFilename}", "r")) !== FALSE) {             // Open the file for reading
                                                                    while (($data = fgetcsv($h, 500, ";")) !== FALSE){
                                                                            $dataArray[] = $data;
                                                                            echo '<tr>';
                                                                            $i=0;
                                                                            foreach ($data as $column) {
                                                                                    $i++;
                                                                                    if (($fh = fopen("{$userFilename}", "a")) !== FALSE) {}             // Open the file for writing
                                                                                    if ($i==1){
                                                                                            fwrite($fh,substr(htmlspecialchars($column)."\n",6));       // Write name of connected user
                                                                                            if ($nameSelected == "" || $nameSelected == "Choose one"){
                                                                                                    echo '<td>'.substr(htmlspecialchars($column),6).'</td>';
                                                                                            }else{
                                                                                                    if (substr(htmlspecialchars($column),6)==$nameSelected) {
                                                                                                            echo '<td>'.substr(htmlspecialchars($column),6).'</td>';
                                                                                                    }else{
                                                                                                            $i=99;
                                                                                                    }
                                                                                            }
                                                                                    }elseif($i==2){
                                                                                            echo '<td>'.htmlspecialchars($column).'</td>';
                                                                                    }elseif($i==3){
                                                                                            if (strpos($column,"DISCONNECTED") !== false){
                                                                                                    $eventStatus="DISCONNECT";
                                                                                                    echo '<td>'.substr(htmlspecialchars($column),18).'</td>';
                                                                                            }else{
                                                                                                    $eventStatus="CONNECT";
                                                                                                    echo '<td>'.substr(htmlspecialchars($column),15).'</td>';
                                                                                            }
                                                                                    }elseif($i==4){
                                                                                            echo '<td>'.substr(htmlspecialchars($column),3).'</td>';
                                                                                    }elseif($i==5){
                                                                                            if ($eventStatus=="CONNECT") {
                                                                                                    $needle = "IP";
                                                                                                    $insertCode = "<br/>";
                                                                                                    $pos = strpos($column, $needle);
                                                                                                    $newColumn = substr_replace($column, $insertCode , $pos , 0);
                                                                                                    $newColumn = str_replace("INTERNAL","<BR/> INTERNAL",$column);
                                                                                                    echo '<td>'.$newColumn.'</td>';
                                                                                            }elseif($eventStatus=="DISCONNECT") {
                                                                                                    //Manipulate Time
                                                                                                    $seconds=strstr(substr(htmlspecialchars($column),10), "s", true);
                                                                                                    $secondsCounter += $seconds;
                                                                                                    //Display Data
                                                                                                    echo '<td>'.str_replace("DATA","<BR/> DATA",$column).'</td>';
                                                                                                    //Manipulate Data Uploaded
                                                                                                    $dataUploaded = strstr(substr(strstr($column, "): ", false),3)," ", true);
                                                                                                    $dataUploadedTotal += $dataUploaded;
                                                                                                    //Manipulate Data Downloaded
                                                                                                    $dataDownloaded = strstr(substr(strstr(substr(strstr($column, "): ", false),3), "): ", false),3)," ", true);
                                                                                                    $dataDownloadedTotal += $dataDownloaded;
                                                                                            }
                                                                                    }
                                                                            }
                                                                            echo '</tr>'.PHP_EOL;
                                                                            fclose($fh);
                                                                    }
                                                            }
                                            
                                                    echo '<tr><td></td><td></td><td></td><td></td><td>Total Time Connected: <strong>'.seconds2human($secondsCounter) . '</strong>';
                                                    echo '<br />Total Data Uploaded (Received): <strong>' . $dataUploadedTotal . ' MB</strong>';
                                                    echo '<br />Total Data Downloaded (Sent): <strong>' . $dataDownloadedTotal . ' MB</strong></td></tr>';
                                            
                                            
                                            
                                                    echo "</tbody></table>";
                                            echo "</div>";
                                            
                                            
                                            
                                            
                                            
                                            $arrUserlist = file("$userFilename", FILE_IGNORE_NEW_LINES);
                                            echo "<form method='post' action='vpn_openvpn_userlogging.php'>";
                                            echo "<select name='user_selected'><option selected='selected'>Choose one</option>";
                                            
                                            foreach(array_unique($arrUserlist) as $item){
                                                    ?><option value="<?php echo $item; ?>"><?php echo $item; ?></option><?php
                                            }
                                            echo "</select><input type='submit' value='Submit'></form>";
                                            
                                            ?>
                                            
                                            <!--This section isn't used yet.  Can't get it to implement the datatable and still keep the formatting properly. -->
                                            
                                            <!-- This loads up the basic jQuery library (version 3.6.0) -->
                                            <script src="//code.jquery.com/jquery-3.6.0.min.js"></script>
                                            
                                            <!-- This loads up the CSS styling for the resulting DataTable (e.g. sorting icons, basic formatting, etc) -->
                                            <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.11.1/css/jquery.dataTables.min.css" />
                                            
                                            <!-- This loads up the jQuery plugin that enables the use of the DataTable() function used below -->
                                            <script src="//cdn.datatables.net/1.11.1/js/jquery.dataTables.min.js"></script>
                                            
                                            <!-- This will (when the page loads completely) find the table with the ID of "tblResults" and format it with the DataTables plugin -->
                                            
                                            <script>
                                            // When the page is loaded...
                                            $(document).ready( function () {
                                            
                                                // This one command does all the work
                                                $('#tblResults').DataTable();
                                            
                                            } );
                                            </script>
                                            
                                            </body>
                                            </html>
                                            
                                            
                                            <?php include("foot.inc");?>
                                            
                                            

                                            What I'd like to do is make the table filterable based on users and date range. I was going to start trying it in php but maybe it's already a built-in class that's been made like how it is already sortable. I've also had Javascript recommended to me. I don't want to reinvent the wheel so let me know if I'm missing something. I'd also like to add in a function to sum up all of the time of the disconnected sessions to see how long someone has been connected. That way administrators can see how long a user was connected over a day, or week, or however long they want to see for. I'd also like to tally up the data usage for visibility.

                                            Edit: Since nobody has replied since I posted it, I've updated the code for whomever is interested. I guess all that's left is to filter by date range.

                                            Edit 2: Sample Output
                                            04ce19a2-a833-4ee1-a876-5ac7f0e82129-image.png

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