hello,
I am using freeradius-1.0.0 and mysql.It is able to send an
authentication request and getting back the reply using mysql. I am
trying to use rlm_sqlcounter module so as to allow the user time limit
to some 10 hours.So i am trying to use noreset counter . I have followed
all the steps involved in /usr/local/freeradius-1.0.0/doc/rlm_sqlcounter
file . Now if i send an accounting request initially with
Acct-Status-Type=1 and after some time with Acct-Status-Type=2 the
RADIUS server sends back the reply for both without any error.The
Actstarttime and Acctstoptime are stored on radacct table but
Acctsessiontime is stored as zero on radacct table.

Here are the steps that i followed

1)configured freeradius with
make clean
 ./configure --with-experimental-modules
  make
  make install

2)Created a text file called sqlcounter.conf under raddb and i included
following things


sqlcounter noresetcounter {
                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}'"
 

 }
 

 

sqlcounter dailycounter {
                driver = "rlm_sqlcounter"
                counter-name = Daily-Session-Time
                check-name = Max-Daily-Session
                sqlmod-inst = sqlcca3
                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'"
 

        }
 

sqlcounter monthlycounter {
                counter-name = Monthly-Session-Time
                check-name = Max-Monthly-Session
                sqlmod-inst = sqlcca3
                key = User-Name
                reset = monthly
 

                query = "SELECT SUM(AcctSessionTime - GREATEST((%b -
UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}'
AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"
 

        }

3) In radiusd.conf
modules {
      $INCLUDE  ${confdir}/sql.conf

      $INCLUDE  ${confdir}/sqlcounter.conf
}

4)In radiusd.conf
authorize {
...some entries here...
...some entries here...
...some entries here...
...some entries here...
 

noresetcounter
dailycounter
monthlycounter
}

5) In mysql
INSERT into radcheck VALUES
('2','test0002','Max-All-Session','10800',':=');

Now can anyone tell me how to get this Acctsessiontime on radacct table?
and please highlight
where i have gone wrong in my configuration?

Thanks in advance
regards,
manjunath

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to