sqlcounters for traffic

Edvin Seferovic edvin.seferovic at kolp.at
Sat Sep 6 02:25:59 CEST 2008


rlm_sqlcounter: Sent Reply-Item for user scott, Type=Session-Traffic-Limit,
value=12792



Which part don’t you understand? Sqlcounter returned it. How does the log
part of the RADIUS Packet looks like? It should contain the
“Session-Traffic-Limit” if it can be found in the dictionary, right?

 

E:S

 

From: freeradius-users-bounces+edvin.seferovic=kolp.at at lists.freeradius.org
[mailto:freeradius-users-bounces+edvin.seferovic=kolp.at at lists.freeradius.or
g] On Behalf Of Alexandre Chapellon
Sent: Samstag, 06. September 2008 01:53
To: FreeRadius users mailing list
Subject: sqlcounters for traffic

 

I want to se sqlcounters to count bytes transferred from clients so that i
manage quota.
Aiming this i configured the following counter:

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

My first problem is that the Session-Traffic-Limit (from the redback
dictionnary) is not returned. I can't see it neither in the output of
radtest nor with radsniff.
Yet, looking at the output of radiusd -X i can see it's correctly understood
by freeradius:

rlm_sqlcounter: Check item is greater than query result
rlm_sqlcounter: Authorized user scott, check_item=12000, counter=10891
rlm_sqlcounter: Sent Reply-Item for user scott, Type=Session-Traffic-Limit,
value=12792
++[bytesQuota] returns ok

Does anyone has a clue?

Alexandre Chapellon a écrit : 

You're right, adding the name of my sqlcounter in the instantiate section
lake it works.
thx :)

Alan DeKok a écrit : 

Alexandre Chapellon wrote:
  

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"
    

 
  The modules are initialized in *order*.  The sqlcounter module creates
the attributes on the fly.  But... it can't do this if it hasn't been
run yet.
 
  

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
    

 
  That isn't the correct dictionary file format, but it's not relevant,
either.
 
  

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?
    

 
  List "sqlcounter" in the "instantiate" section.  It will be
initialized before the "users" file is read.
 
  Alan DeKok.
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
 
  
 



  _____  



 
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20080906/831fb82f/attachment.html>


More information about the Freeradius-Users mailing list