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

    Captive Portal Last Activity

    Scheduled Pinned Locked Moved Captive Portal
    18 Posts 2 Posters 1.8k 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.
    • ahmetakkayaA
      ahmetakkaya @Gertjan
      last edited by

      @gertjan said in Captive Portal Last Activity:

      PHP script

      The PHP script you shared is on the pfsense side

      needed me by freeradius

      Does pfsense share the latest activitiy information on freeradius?

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

        @ahmetakkaya said in Captive Portal Last Activity:

        The PHP script you shared is on the pfsense side

        For an activate clients, In the radacct table a record with all the info about this connected client :

        bc72e24e-e682-49bd-a129-1f9a544fd27d-image.png

        My accounting updates this record every 600 (605) seconds.

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

        ahmetakkayaA 1 Reply Last reply Reply Quote 0
        • ahmetakkayaA
          ahmetakkaya @Gertjan
          last edited by

          @gertjan

          Ekran Alıntısı.JPG

          this is my radacct table

          There is user login time in the marked field
          The variable at the bottom always shows the current time.
          I couldn't find the activity information in the table?

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

            @ahmetakkaya

            I meant the "acctinputocters" and "acctoutpitoctests". The are updated every "accounting update", nomally 5 minutes.

            This info is collected by pfSense, by reading these byte counters, using an ipfw command, then then handed over to FreeRadius.
            Freeradius needs this info if you want to quota limit users.

            Something like real time graphing: not that I know of.

            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
            • ahmetakkayaA
              ahmetakkaya
              last edited by

              freeradius unfortunately does not send last activity information to remote sql accounting server ..

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

                @ahmetakkaya said in Captive Portal Last Activity:

                does not send last activity information

                The record that I showed above will get updated every 600 seconds, of whatever time span you chose. When the connection gets closed, the record will have a STOP time set and the record will not get updated any more.

                What do you mean by "activity information" ?

                You want to know what the connected user does ? What they visits ?
                A "Captive portal" is more about granting access to the net, and also "how long" and "how many bytes". Not what they are actually doing.
                If you want to know what a user does, what he's looking at, you have become a MITM-man.

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

                ahmetakkayaA 1 Reply Last reply Reply Quote 0
                • ahmetakkayaA
                  ahmetakkaya @Gertjan
                  last edited by

                  @gertjan

                  I found the last activity information in the captive portal status menu on the pfsense webgui screen.

                  I want to see it on the remote accounting portal page that I have created.

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

                    @ahmetakkaya said in Captive Portal Last Activity:

                    I want to see it on the remote accounting portal page that I have created.

                    Then use the script I showed above ?
                    The same info is synced to Freeradius, every time a 'accounting' is updated, but this which happens every 5 minutes or so :

                    ae5fc22c-94d3-45cc-8a2f-79e09b8a3990-image.png

                    So, it would be every minute ?! the SQL database is updated.

                    The function "captiveportal_get_last_activity()" in the script questions the ipfw pipes info directly, it gets the time stamp of the latest packet-event. Identical to what pfSense does when it shows the last activity.

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

                    ahmetakkayaA 1 Reply Last reply Reply Quote 0
                    • ahmetakkayaA
                      ahmetakkaya @Gertjan
                      last edited by

                      @gertjan

                      I already have my settings as in the picture

                      How can I query the last activity information on the accounting side or on the sql side?

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

                        @ahmetakkaya said in Captive Portal Last Activity:

                        @gertjan

                        I already have my settings as in the picture

                        How can I query the last activity information on the accounting side or on the sql side?

                        I doubt the If the result of "captiveportal_get_last_activity()" is actually stored in the SQL database.
                        The 'acctupdatetime' (updated every 'actinterval' = env 600 seconds) together with acctinputoctets and acctoutputoctets could used to see if there was any activity during the last 'actinterval' seconds.

                        The radpostauth table contains an every minute a recheck of the login (if you enabled that feature).

                        A real time updating of the results of the "ipfw" can't be transmitted to Freeradius. Run radius -X for your self to see what is send between the pfSense captive portal and Freeradius.

                        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
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.