Radacct update at 3 hours

Fajar A. Nugraha list at fajar.net
Sat Dec 3 14:08:02 CET 2011


On Sat, Dec 3, 2011 at 6:23 PM, Hitesh Vinzoda <hiteshvinzoda at yahoo.com> wrote:
> Hi all,
>
> I get this working now. Thanks a lot to you guys. Now i want to test one
> more feature, i.e. Is there a way where we can set the accounting updates to
> be triggered at a specific time of a day e.g. everynight at 23:59. My gut
> feeling is this has to be configured on the NAS.

Short version: You can't. Don't bother. Really.

Long version:
There's two attributes that radius can send that MAY be able to do
what you want, in a rundabout fashion.

First one is Session-Timout, which basically tells the NAS the maximum
time the session can last before the NAS have to cut it off
forcefully. In some types of connection (e.g. 3G, or ADSL with the
modem dialing) the client will then try to reconnect immediately, so
this might effectively have the same effect with what you want. You
can use unlang with sql expansion (mysql has some nice function for
date/time calculation) or exec to calculate the value of
Session-Timeout which would make the NAS drops the connection at
23:59.

The second one is Acct-Interim-Interval. Similar to above, you can
calculate Acct-Interim-Interval in a way that you'd get an
Acct-Interim packet at 23:59. For example:
- the client is connected on 06:00
- you want interim updates to be sent (roughly) every 3 hours
- If you set Acct-Interim-Interval to be 2 hours, 59 minutes and 10
seconds (i.e. 10750 seconds) the NAS should (hopefuly) send an
Acct-Interim packet somewhere around 23:59.
- you can use unlang with sql or exec (same as above) to perform the
necessary Acct-Interim-Interval calculation, but it will be
complicated.

I suugest you don't bother with either. Really. Just set
Acct-Interim-Interval into something managable (e.g. 1 hour), and for
billing purposes just use whatever information available at that time
(e.g. use last Acct-Interim sent before 23:59).

-- 
Fajar



More information about the Freeradius-Users mailing list