problem with counter reset In hourly -daily -weekly -monthly
SORROW
ulmzcb at yahoo.com
Fri Jan 10 16:44:13 CET 2014
hello friends
I Test freeradius and run in ubuntu+MySql+Mikrotik as NAS .. FreeRADIUS
Version 2.1.10, for host i686-pc-linux-gnu, built on Sep 24 2012
for limit Download user traffic daily i user this setting in /etc/freeradius/sql/mysql/counter.conf
====
sqlcounter counterChilliSpotMaxTotalOctetsDaily {
counter-name = ChilliSpot-Max-Total-Octets-Daily
check-name = CS-Total-Octets-Daily
counter-type = data
reply-name = Mikrotik-Xmit-Limit
sqlmod-inst = sql
key = User-Name
reset = daily
query = "SELECT (SUM(AcctInputOctets + AcctOutputOctets)) FROM radacct
WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) +
AcctSessionTime > '%b'"
}
====
Now i have problem in reset= hourly - daily - weekly Or monthly . I dont
know how to fix it for example i set for user CS-Total-Octets-Daily
check attribute 10MB .. user in first login use 9MB and disconnect and re login again can use 10MB !! user must disconnect after 1MB and user stay connect ! in this example sum of two connection usage is 19MB !!!
But if reset = never counter working correctly and user disconnected in exact usage ...
in freeradius -X if reset = never Reply-Item for user is correct value
[counterChilliSpotMaxTotalOctetsDaily] expand: %{sql:SELECT (SUM(AcctInputOctets + AcctOutputOctets)) FROM radacct WHERE UserName='test4' AND UNIX_TIMESTAMP(AcctStartTime) +
AcctSessionTime > '0'} -> 766328
rlm_sqlcounter: Check item is greater than query result
rlm_sqlcounter: Authorized user test4, check_item=1000000, counter=766328
rlm_sqlcounter: Sent Reply-Item for user test4, Type=Mikrotik-Xmit-Limit, value=233672
++[counterChilliSpotMaxTotalOctetsDaily] returns ok
=====
In freeradius -X if reset = daily Reply-Item for user is not correct value
[counterChilliSpotMaxTotalOctetsDaily] expand: %{sql:SELECT (SUM(AcctInputOctets + AcctOutputOctets)) FROM radacct WHERE UserName='test4' AND UNIX_TIMESTAMP(AcctStartTime) +
AcctSessionTime > '1389299400'} -> 727301
rlm_sqlcounter: Check item is greater than query result
rlm_sqlcounter: Authorized user test4, check_item=1000000, counter=727301
rlm_sqlcounter: Sent Reply-Item for user test4, Type=Mikrotik-Xmit-Limit, value=1031030
++[counterChilliSpotMaxTotalOctetsDaily] returns ok
how can i solve this ??
regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20140110/cded4c29/attachment.html>
More information about the Freeradius-Users
mailing list