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