[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeradius-users
Subject:    Help with sqlcounter for data transferred
From:       Fabrizio Fiore Donati <fabrizio.fioredonati () 2bite ! net>
Date:       2013-09-25 16:57:51
Message-ID: CAJeiZse3NODyQqpG7+U+bQ_XB_w0vLVv2H+E=NussNqjbhZ93Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,
i'm configuring a server with a sql counter to check the total byte in a
week for the users.
But the server will reply a wrong count.

Here's the counter:

sqlcounter weeklybytecounter {
counter-name = Weekly-Total-Max-Octets
check-name = Max-Weekly-Octets
reply-name = Mikrotik-Total-Limit
sqlmod-inst = sql
key = User-Name
reset = weekly
query = "SELECT (SUM(acctinputoctets)+SUM(acctoutputoctets)) FROM radacct
WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime
> '%b'"


But the reply doesn't is the operation between (check-name value) - (query
value)

for example:

rlm_sqlcounter: Authorized user fabrizio, check_item=3000000000,
counter=38101894

I expect a reply of 3000000000 - 38101894 = 2961898106

but i receive different value also bigger.....


Any idea ?


-- 
Fabrizio Fiore Donati

Mobile: +39 3289872420
E-mail: fabrizio.fioredonati@2bite.net

2bite s.r.l.
Via Saragat snc
67100 L'Aquila (AQ) - Italy
Tel.: +39 0862441583

[Attachment #5 (text/html)]

<div dir="ltr">Hi,<div>i&#39;m configuring a server with a sql counter to check the \
total byte in a week for the users.</div><div>But the server will reply a wrong \
count.</div><div><br></div><div>Here&#39;s the counter:</div> \
<div><br></div><div><div>sqlcounter weeklybytecounter {</div><div>counter-name = \
Weekly-Total-Max-Octets</div><div>check-name = Max-Weekly-Octets</div><div>reply-name \
= Mikrotik-Total-Limit</div><div>sqlmod-inst = sql<br> </div><div>key = User-Name  \
</div><div>reset = weekly  </div><div>query = &quot;SELECT \
(SUM(acctinputoctets)+SUM(acctoutputoctets)) FROM radacct WHERE \
UserName=&#39;%{%k}&#39; AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime &gt; \
&#39;%b&#39;&quot;</div> <div><br></div><div><br></div><div>But the reply doesn&#39;t \
is the operation between (check-name value) - (query value)<br><br></div><div>for \
example:</div><div><br></div><div>







<p class="">rlm_sqlcounter: Authorized user fabrizio, check_item=3000000000, \
counter=38101894</p><p class="">I expect a reply of 3000000000 - 38101894 = \
2961898106</p><p class="">but i receive different value also bigger.....</p> <p \
class=""><br></p><p class="">Any idea ?</p><p class=""><br></p></div><div>-- \
</div>Fabrizio Fiore Donati<br><br>Mobile: +39 3289872420<br>E-mail: <a \
href="mailto:fabrizio.fioredonati@2bite.net" \
target="_blank">fabrizio.fioredonati@2bite.net</a><br> <br>2bite s.r.l.<br>Via \
Saragat snc<br>67100 L&#39;Aquila (AQ) - Italy<br>Tel.: +39 0862441583 </div></div>



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic