using sqlcounters

Alexandre Chapellon alexandre.chapellon at mana.pf
Fri Sep 5 04:37:53 CEST 2008


Hello,

I want to setup sqlcounter to prevent users to login once they have
reached traffic quota.
So i added a new specific sqlcounter in
raddbb_dir/sql/mysql/counter.conf, and the name of that counter in the
authrorize section.
All is as follow:

#####counter.conf#####
sqlcounter bytesQuota {
        counter-name = traffic_quota
        check-name = Max-Traffic
        sqlmod-inst = mysqldb
        key = User-Name
        reset = hourly
        query = "SELECT SUM(acctinputoctets + acctoutputoctets) FROM
radacct WHERE UserNmae='%{%k}'"
}

#####virtual_server#####
authorize {
...
bytesQuota
}

#####users file#####
scott Mana-Traffic = 101, Cleartext-Password := "tiger"

whenever i launch freeradius -X I get the folloawing error:
/etc/freeradius/users[205]: Parse error (check) for entry scott: Invalid
octet string "101" for attribute name "Max-Traffic"

Line 205 is the line where user scott is defined in users files.
I have tryed setting up my own dictionnary (which i think shouldn't be
needed) with the Max-Traffic attribute defined as interger

VENDOR ME
ATTRIBUTE       Max-Traffic     1       integer

But that doesn't help. I have read all over the web that sqlcounter with
mysql are considered as stable enough for production , so am quite
surprised of this issue...
Any idea?



More information about the Freeradius-Users mailing list