• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
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.5k 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.
  • A
    ahmetakkaya @Gertjan
    last edited by Aug 30, 2021, 7:55 AM

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

    G 1 Reply Last reply Aug 30, 2021, 9:52 AM Reply Quote 0
    • G
      Gertjan @ahmetakkaya
      last edited by Aug 30, 2021, 9:52 AM

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

      A 1 Reply Last reply Aug 30, 2021, 10:13 AM Reply Quote 0
      • A
        ahmetakkaya @Gertjan
        last edited by Aug 30, 2021, 10:13 AM

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

        G 1 Reply Last reply Aug 30, 2021, 10:50 AM Reply Quote 0
        • G
          Gertjan @ahmetakkaya
          last edited by Aug 30, 2021, 10:50 AM

          @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
          • A
            ahmetakkaya
            last edited by Sep 2, 2021, 8:18 PM

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

            G 1 Reply Last reply Sep 3, 2021, 9:31 AM Reply Quote 0
            • G
              Gertjan @ahmetakkaya
              last edited by Sep 3, 2021, 9:31 AM

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

              A 1 Reply Last reply Sep 3, 2021, 12:52 PM Reply Quote 0
              • A
                ahmetakkaya @Gertjan
                last edited by Sep 3, 2021, 12:52 PM

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

                G 1 Reply Last reply Sep 6, 2021, 7:35 AM Reply Quote 0
                • G
                  Gertjan @ahmetakkaya
                  last edited by Sep 6, 2021, 7:35 AM

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

                  A 1 Reply Last reply Sep 6, 2021, 7:49 AM Reply Quote 0
                  • A
                    ahmetakkaya @Gertjan
                    last edited by Sep 6, 2021, 7:49 AM

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

                    G 1 Reply Last reply Sep 6, 2021, 8:23 AM Reply Quote 0
                    • G
                      Gertjan @ahmetakkaya
                      last edited by Sep 6, 2021, 8:23 AM

                      @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
                      18 out of 18
                      • First post
                        18/18
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                        This community forum collects and processes your personal information.
                        consent.not_received