<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I want to se sqlcounters to count bytes transferred from clients so
that i manage quota.<br>
Aiming this i configured the following counter:<br>
<br>
sqlcounter bytesQuota {<br>
counter-name = traffic_quota<br>
check-name = Max-Traffic<br>
reply-name = Session-Traffic-Limit<br>
sqlmod-inst = mysqldb<br>
key = User-Name<br>
reset = hourly<br>
query = "SELECT SUM(acctinputoctets + acctoutputoctets) FROM
radacct WHERE UserName='%{%k}'"<br>
}<br>
<br>
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.<br>
Yet, looking at the output of radiusd -X i can see it's correctly
understood by freeradius:<br>
<br>
rlm_sqlcounter: Check item is greater than query result<br>
rlm_sqlcounter: Authorized user scott, check_item=12000, counter=10891<br>
rlm_sqlcounter: Sent Reply-Item for user scott,
Type=Session-Traffic-Limit, value=12792<br>
++[bytesQuota] returns ok<br>
<br>
Does anyone has a clue?<br>
<br>
Alexandre Chapellon a écrit :
<blockquote cite="mid:48C16E95.7030406@mana.pf" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
You're right, adding the name of my sqlcounter in the instantiate
section lake it works.<br>
thx :)<br>
<br>
Alan DeKok a écrit :
<blockquote cite="mid:48C0C273.8070107@deployingradius.com"
type="cite">
<pre wrap="">Alexandre Chapellon wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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"
</pre>
</blockquote>
<pre wrap=""><!---->
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.
</pre>
<blockquote type="cite">
<pre wrap="">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
</pre>
</blockquote>
<pre wrap=""><!---->
That isn't the correct dictionary file format, but it's not relevant,
either.
</pre>
<blockquote type="cite">
<pre wrap="">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?
</pre>
</blockquote>
<pre wrap=""><!---->
List "sqlcounter" in the "instantiate" section. It will be
initialized before the "users" file is read.
Alan DeKok.
-
List info/subscribe/unsubscribe? See <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://www.freeradius.org/list/users.html">http://www.freeradius.org/list/users.html</a>
</pre>
</blockquote>
<pre wrap="">
<hr size="4" width="90%">
-
List info/subscribe/unsubscribe? See <a class="moz-txt-link-freetext" href="http://www.freeradius.org/list/users.html">http://www.freeradius.org/list/users.html</a></pre>
</blockquote>
</body>
</html>