<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Edvin Seferovic a écrit :
<blockquote cite="mid:054301c90fb7$22c35bf0$684a13d0$@seferovic@kolp.at"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal"><span lang="EN-US">rlm_sqlcounter: Sent
Reply-Item for user
scott, Type=Session-Traffic-Limit, value=12792<br>
<br>
</span><span
style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US">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?</span></p>
</div>
</blockquote>
<br>
What i don't understand is that i cannot find this in the sent reply,
whereas it seems to be processed correctly by the module.<br>
<br>
<blockquote cite="mid:054301c90fb7$22c35bf0$684a13d0$@seferovic@kolp.at"
type="cite">
<div class="Section1">
<p class="MsoNormal"><span
style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US">E:S<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US"><o:p> </o:p></span></p>
<div>
<div
style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: windowtext;"
lang="EN-US">From:</span></b><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: windowtext;"
lang="EN-US">
<a class="moz-txt-link-abbreviated" href="mailto:freeradius-users-bounces+edvin.seferovic=kolp.at@lists.freeradius.org">freeradius-users-bounces+edvin.seferovic=kolp.at@lists.freeradius.org</a>
[<a class="moz-txt-link-freetext" href="mailto:freeradius-users-bounces+edvin.seferovic=kolp.at@lists.freeradius.org">mailto:freeradius-users-bounces+edvin.seferovic=kolp.at@lists.freeradius.org</a>]
<b>On
Behalf Of </b>Alexandre Chapellon<br>
<b>Sent:</b> Samstag, 06. September 2008 01:53<br>
<b>To:</b> FreeRadius users mailing list<br>
<b>Subject:</b> sqlcounters for traffic<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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 : <o:p></o:p></p>
<p class="MsoNormal">You're right, adding the name of my sqlcounter
in the
instantiate section lake it works.<br>
thx :)<br>
<br>
Alan DeKok a écrit : <o:p></o:p></p>
<pre>Alexandre Chapellon wrote:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<pre>whenever i launch freeradius -X I get the folloawing error:<o:p></o:p></pre>
<pre>/etc/freeradius/users[205]: Parse error (check) for entry scott: Invalid<o:p></o:p></pre>
<pre>octet string "101" for attribute name "Max-Traffic"<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre><o:p> </o:p></pre>
<pre> The modules are initialized in *order*. The sqlcounter module creates<o:p></o:p></pre>
<pre>the attributes on the fly. But... it can't do this if it hasn't been<o:p></o:p></pre>
<pre>run yet.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<pre>Line 205 is the line where user scott is defined in users files.<o:p></o:p></pre>
<pre>I have tryed setting up my own dictionnary (which i think shouldn't be<o:p></o:p></pre>
<pre>needed) with the Max-Traffic attribute defined as interger<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>VENDOR ME<o:p></o:p></pre>
<pre>ATTRIBUTE Max-Traffic 1 integer<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre><o:p> </o:p></pre>
<pre> That isn't the correct dictionary file format, but it's not relevant,<o:p></o:p></pre>
<pre>either.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<pre>But that doesn't help. I have read all over the web that sqlcounter with<o:p></o:p></pre>
<pre>mysql are considered as stable enough for production , so am quite<o:p></o:p></pre>
<pre>surprised of this issue...<o:p></o:p></pre>
<pre>Any idea?<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
<pre><o:p> </o:p></pre>
<pre> List "sqlcounter" in the "instantiate" section. It will be<o:p></o:p></pre>
<pre>initialized before the "users" file is read.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> Alan DeKok.<o:p></o:p></pre>
<pre>-<o:p></o:p></pre>
<pre>List info/subscribe/unsubscribe? See <a moz-do-not-send="true"
href="http://www.freeradius.org/list/users.html">http://www.freeradius.org/list/users.html</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre style="text-align: center;">
<hr align="center" size="4" width="90%">
</pre>
<pre><o:p> </o:p></pre>
<pre>-<o:p></o:p></pre>
<pre>List info/subscribe/unsubscribe? See <a moz-do-not-send="true"
href="http://www.freeradius.org/list/users.html">http://www.freeradius.org/list/users.html</a><o:p></o:p></pre>
</div>
<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>