1 (edited by yky202082 2009-12-30 09:42:59)

Topic: freeraius sqlcounter dailycounter

how can I make it success?
I try many time still cannot count down.

my config =>
sqlcounter dailycounter {
        counter-name = Daily-Session-Time
        check-name = Max-Daily-Session
        reply-name = Session-Timeout
        sqlmod-inst = sql
        key = User-Name
        reset = daily
        query = "SELECT SUM(AcctSessionTime - \
                 GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) \
                 FROM radacct WHERE UserName='%{%k}' AND \
                 UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"
}

authorize {
    ....
        sql
        dailycounter
        ....
}
radcheck table=>
+----+----------+-------------------+----+----------+
| id | UserName | Attribute         | op | Value    |
+----+----------+-------------------+----+----------+
|  1 | test     | Max-Daily-Session | := | 600       |
|  7 | test     | Password          | := | testpass |
+----+----------+-------------------+----+----------+

when I change the order in authorize
dailycounter
sql
login fail.........
What step am I missing or wrong during config ?
And I want to ask when I uncomment both files and sql in authorize, login will be fail, after I comment one of these two, login become success, what happen?

2 (edited by yky202082 2009-12-30 11:39:11)

Re: freeraius sqlcounter dailycounter

try stop session, then start session again.

I try a lot before.But the counter in pop up window still start from 00:00:00 and no limit time in session
I have a testing before is try to add a attribute "Session-Timeout" to radreply table directly, it can work fine and count down form the value I set in radreply table to 00:00:00 (I use hotspotlogin.php)

maybe you have same user account in both bases - in "files" and in "sql"

I am sure there have not the same account

3 (edited by yky202082 2009-12-30 14:54:04)

Re: freeraius sqlcounter dailycounter

dmkhn wrote:
yky202082 wrote:

I have a testing before is try to add a attribute "Session-Timeout" to radreply table directly, it can work fine and count down form the value I set in radreply table to 00:00:00 (I use hotspotlogin.php)

so, add your "Max-Daily-Session" to table radreply too

I already try it and it doesn't work. The result is the same as normal login and start from 00:00:00.
I see the Implementation in freeradius wiki and it teach me insert this attribute and set the value in radcheck table. I follow the instruction in freeradius wiki still won't work.><
I follow this instruction
http://wiki.freeradius.org/Rlm_sqlcount … ementation

4 (edited by yky202082 2009-12-31 07:36:17)

Re: freeraius sqlcounter dailycounter

Are you using this counter from sqlcounter.conf?
Did you included sqlcounter.conf in your radius configuration?

I use the module in radiusd.conf(I use the yum install 1.1.X ver, it default in radiusd.conf). The content the same as sqlcounter.conf, I think no necessary to create a new file sqlcounter.conf.

5 (edited by yky202082 2010-01-01 08:05:02)

Re: freeraius sqlcounter dailycounter

dmkhn wrote:

i remember - in my case i use traffic limit counter/ If it used for client account, on login pop-up page time counter start from 00:00 and counts in forward direction. But when client reach limit, chilli disconnect him. So just try - setup little amount of time for "test user" account, and login to chilli by this "test user". May be chilli will succesfully disconnect him after that time. Or another posibility - when "test user" reach limit of time, logout from chilli, and try to login again. Chilli must don't let him to login...

I try to set the value to 60 seconds and reload the page in login client. The client still can access to Internet after reach the limit time.

and one more (but it's maybe don't counts for your trouble) - did you added chillispot dictionary in radius configuration?

chillispot dictionary???what this?

Re: freeraius sqlcounter dailycounter

thank, dmkhn!
I find the problem now. In accounting, I un-comment both sql and sql_log and this lead the counter cannot work. After I comment sql_log and add dailycounter in instantiate, it can work well.
But I still have a problem that is I cannot user both files and sql in authorize. When I un-comment both, login success in files but fail in sql. Comment files sql can success but I cannot use the account in files.