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

List:       freeradius-users
Subject:    RE: SQLm_counter and 64 bit values
From:       Jonathan Bastin <jonathan.bastin () peerpointinternet ! co ! uk>
Date:       2012-06-26 15:47:10
Message-ID: 002b01cd53b2$f2c2cff0$d8486fd0$ () peerpointinternet ! co ! uk
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I have been looking in this more and I have another freeradius box with Ubuntu x64 \
12.04 LTS with freeradius 2.1.10 and this works fine so I upgraded mine to the same \
with no luck. Freeradius for the accounting is working fine with 64bit counters so I \
am struggling to find an answer.

From: freeradius-users-bounces+jonathan.bastin=peerpointinternet.co.uk@lists.freeradius.org \
[mailto:freeradius-users-bounces+jonathan.bastin=peerpointinternet.co.uk@lists.freeradius.org] \
                On Behalf Of Jonathan Bastin
Sent: 25 June 2012 11:43
To: freeradius-users@lists.freeradius.org
Subject: FW: SQLm_counter and 64 bit values

I am using Freeradius 2 on Ubuntu 64 bit machine. I am trying to add up the months' \
worth of data the user has used and make sure they don't go over capacity.

So far I have counter.conf:

sqlcounter monthlydata {
                                counter-name = Total-Octets-Monthly
                                check-name = CS-Total-Octets-Monthly
                                reply-name = menu
                                sqlmod-inst = sql
                                key = User-Name
                                reset = never
                query = "SELECT SUM( AcctInputOctets + AcctOutputOctets) FROM radacct \
WHERE UserName='%{%k}' AND AcctStartTime > (DATE_SUB(CURDATE(),INTERVAL \
DAYOFMONTH(CURDATE())DAY))" }

And in the users I have a check value of CS-Total-Octets-Monthly := 107375000000

The issue I am having is that I get Debug: rlm_sqlcounter: (Check item - counter) is \
less than zero which I believe is because the sql query returns a value bigger than \
32bit and the sql counter module isn't 64 bit counter.


Is anybody able to offer me advise on where to go with this one. I did read this \
thread but no real fix came out of it \
http://freeradius.1045715.n5.nabble.com/Problem-with-rml-sqlcounter-with-GigaByte-datavolume-td4455164.html
                
-------------------------------------------------------------------------------------------------------------------------- \
This email (including any attachments) is intended only for the recipient(s) named \
above. It may contain confidential or privileged information and should not be read, \
copied or otherwise used by any other person. If you are not the named recipient \
please contact the sender and delete the email from your system. The author's \
incumbent expressions, views and thoughts are their own and not necessarily \
representative of those of the Peer Point Internet Ltd or associated companies.


[Attachment #5 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
	{font-family:Calibri}
@font-face
	{font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline}
p.msochpdefault, li.msochpdefault, div.msochpdefault
	{margin-right:0cm;
	margin-left:0cm;
	font-size:10.0pt;
	font-family:"Times New Roman","serif"}
span.emailstyle17
	{font-family:"Calibri","sans-serif";
	color:windowtext}
span.emailstyle18
	{font-family:"Calibri","sans-serif";
	color:#1F497D}
span.EmailStyle20
	{font-family:"Calibri","sans-serif";
	color:#1F497D}
.MsoChpDefault
	{font-size:10.0pt}
@page WordSection1
	{margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
	{}
-->
</style>
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">I have been looking in this more and \
I have another freeradius box with Ubuntu x64 12.04 LTS with freeradius 2.1.10 and \
this works fine so I upgraded mine to the same with no luck. Freeradius for the \
accounting  is working fine with 64bit counters so I am struggling to find an \
answer.</span></p> <p class="MsoNormal"><span style="color:#1F497D">&nbsp;</span></p>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt; \
font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
lang="EN-US" style="font-size:10.0pt; \
font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
freeradius-users-bounces&#43;jonathan.bastin=peerpointinternet.co.uk@lists.freeradius.org
  [mailto:freeradius-users-bounces&#43;jonathan.bastin=peerpointinternet.co.uk@lists.freeradius.org]
 <b>On Behalf Of </b>Jonathan Bastin<br>
<b>Sent:</b> 25 June 2012 11:43<br>
<b>To:</b> freeradius-users@lists.freeradius.org<br>
<b>Subject:</b> FW: SQLm_counter and 64 bit values</span></p>
</div>
</div>
<p class="MsoNormal">&nbsp;</p>
<div>
<p class="MsoNormal">I am using Freeradius 2 on Ubuntu 64 bit machine. I am trying to \
add up the months&#8217; worth of data the user has used and make sure they \
don&#8217;t go over capacity.</p> <p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">So far I have counter.conf:</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">sqlcounter monthlydata {</p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
counter-name = Total-Octets-Monthly</p> <p \
class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
check-name = CS-Total-Octets-Monthly</p> <p \
class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
reply-name = menu</p> <p \
class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
sqlmod-inst = sql</p> <p \
class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
key = User-Name</p> <p \
class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
reset = never</p> <p \
class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
query = &quot;SELECT SUM( AcctInputOctets &#43; AcctOutputOctets) FROM radacct WHERE \
UserName='%{%k}' AND AcctStartTime &gt; (DATE_SUB(CURDATE(),INTERVAL \
DAYOFMONTH(CURDATE())DAY))&quot; </p>
<p class="MsoNormal">}</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">And in the users I have a check value of CS-Total-Octets-Monthly \
:= 107375000000</p> <p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">The issue I am having is that I get Debug: rlm_sqlcounter: \
(Check item - counter) is less than zero which I believe is because the sql query \
returns a value bigger than 32bit and the sql counter module isn&#8217;t 64 bit \
counter.</p> <p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Is anybody able to offer me advise on where to go with this one. \
I did read this thread but no real fix came out of it <a \
href="http://freeradius.1045715.n5.nabble.com/Problem-with-rml-sqlcounter-with-GigaByte-datavolume-td4455164.html">
 http://freeradius.1045715.n5.nabble.com/Problem-with-rml-sqlcounter-with-GigaByte-datavolume-td4455164.html</a></p>
 </div>
</div>
-------------------------------------------------------------------------------------------------------------------------- \
This email (including any attachments) is intended only for the recipient(s) named \
above. It may contain confidential or privileged information  and should not be read, \
copied or otherwise used by any other person. If you are not the named recipient \
please contact the sender and delete the email from your system. The author's \
incumbent expressions, views and thoughts are their own and not necessarily  \
representative of those of the Peer Point Internet Ltd or associated companies. \
</body> </html>



-
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