Problem in accounting with sql counter module max-all-session

Bisal bishal at baayu.com.np
Tue Sep 5 10:28:12 CEST 2006


Hi,


 I have setup freeradius 1.1.2 in FreeBSD 6.0 with mysql support. I
have setup user in radcheck table as follows;

1403 | test01   |           |          |        | Max-All-Session | :=
| 1500        |


The user test001 is allowed to login total for 25hrs. After finishing
25hrs if the user recharge his account to 30hrs again and I updated
max-all-session to 1800 seconds in radcheck table.
 Now when the user tries to connect he get disconneted after 5hrs and
when he tried to reconnect, he couldnot get authenticate. In my radius
log I see ;

Mon Sep  4 17:43:56 2006 : Auth: Invalid user (rlm_sqlcounter: Maximum
never usage time reached): [test01] (from client pppoe-bhw port 4448
cli 0:7:95:10:73:9e)

 What could be the problem with sql counter module? In my radiusd.conf
settings I have setup max-all-session counter as follows;

        sqlcounter noresetcounter {
                        driver = "rlm_sqlcounter"
                        counter-name = Max-All-Session-Time
                        check-name = Max-All-Session
                        sqlmod-inst = sql
                        key = User-Name
                        reset = never
                        query = "SELECT SUM(AcctSessionTime) FROM
radacct WHERE UserName='%{%k}'"
        }

  All things are running well except rechargeable account. How could I
make rechargeable sqlcounter module for hourly accounts?
Do I need to create the seperate sqlcounter according to plan? Like if
25hrs then in sqlcounter section "reset=25h", if 50hrs "reset=50h"
.... etc,


Any suggestion?


Bishal



More information about the Freeradius-Users mailing list