Periodic Data Usage Reporting
Max James
xxedlxx101 at gmail.com
Thu Apr 7 15:44:16 UTC 2022
> Yes, it sets the total usage time for all closed sessions, and adds in
the time for the current session.
If a session ends, upon the script's next execution it includes all the
data consumed throughout the lifetime of that session. The expected result
is for only the data consumed since the last script's execution should be
inserted into the "data_usage_by_period" table.
Kind regards,
Max
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Thu, Apr 7, 2022 at 9:33 PM Alan DeKok <aland at deployingradius.com> wrote:
> On Apr 4, 2022, at 12:33 AM, Max James <xxedlxx101 at gmail.com> wrote:
> > I have followed the below "Periodic Data Usage Reporting" article found
> on
> > the freeradius wiki.
> > https://wiki.freeradius.org/guide/Data-Usage-Reporting
> >
> > I am using the postgresql process-radacct.sql script which can be found
> on
> > the freeradius-server github.
> >
> https://github.com/FreeRADIUS/freeradius-server/blob/master/raddb/mods-config/sql/main/postgresql/process-radacct.sql
>
> That's from the "master" branch, but I suppose it should work for v3,
> too.
>
> > The implementation was successful and works as expected, however I did
> > notice an issue that I can't seem to figure out myself.
> >
> > If a users session ends and a new one begins, the next time the
> > fr_new_data_usage_period() function is executed, it seems to be inserting
> > the data usage for that entire session instead of only the data usage
> that
> > was accrued since the last time the function was executed.
>
> Yes, it sets the total usage time for all closed sessions, and adds in
> the time for the current session.
>
> > The function reports usage as expected until it comes across users that
> > have a new session since the function was last executed. I've spent a few
> > hours trying to figure out the cause but I've had no luck. Any advice or
> > help is much appreciated. Thanks in advance.
>
> I'm not sure what's wrong here. The table is updated with the total
> value of session time. That's what it's supposed to do?
>
> Alan DeKok.
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/devel.html
>
More information about the Freeradius-Devel
mailing list