Re: SQL Accounting... ¿Negative?
Gabriel Trabanco Llano
gabriel at trabanco.soy
Wed Sep 4 21:12:54 CEST 2019
I checked the data many times comparing the table I created with the table and redacct and also with the negative data I have exactly the same amount of data for all users… It is strange ¬¬’
Anyway it is not for make a payable access point or whatever to do any payment so if there is any missing 100 mb there is no problem it does not matter if it is approximately or exactly whenever it is close to the right data. The big thing here is that is something that is happening with apparently no explanation because to insert the data on a period if you have seen my solution is based on the timestamp the packet was sent by the NAS and not by the server time.
Thank you for paying attention to me! :)
Gabriel Trabanco
> El 4 sept 2019, a las 17:45, Alan DeKok <aland at deployingradius.com> escribió:
>
> On Sep 4, 2019, at 10:43 AM, Gabriel Trabanco Llano <gabriel at trabanco.soy> wrote:
>> I do not manipulate the original table, it has the original information from the FR.
>
> That's good.
>
>> As far as I can see and I know of database for me when I saw the FR source code is rewrite the total amount of sessiontime, data input/output… So If in the trigger I rest:
>> new_value - old_value
>>
>> So it should contain the difference and I am writing the amount by hours in other table. Why sometimes this value is negative? For my as far as I can see there is not such a way where this value could be negative… Just in the case the NAS is bugged.
>
> RADIUS packets can come out of order.
>
> My $0.02 is to skip using a trigger. Just run a stored procedure at the end of the billing cycle to copy the data to another table. Then, run another stored procedure to do the "diffs" in usage between billing cycles.
>
> That way you're operating on the *data* and not on the *RADIUS packets*. It's much safer.
>
> Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list