Hi, I have added testcounter in instantiate block also. and defined Max-Data := 10 in radius.conf in modules just below the line $INCLUDE sql/mysql/counter.conf But in the logs the following comes. Sat Jun 20 13:36:20 2015 : Debug: rlm_sql (sql): Released sql socket id: 3 Sat Jun 20 13:36:20 2015 : Info: ++[sql] returns ok Sat Jun 20 13:36:20 2015 : Debug: rlm_counter: Entering module authorize code Sat Jun 20 13:36:20 2015 : Debug: rlm_counter: Could not find Check item value pair Sat Jun 20 13:36:20 2015 : Info: ++[daily] returns noop Sat Jun 20 13:36:20 2015 : Debug: rlm_sqlcounter: Entering module authorize code Sat Jun 20 13:36:20 2015 : Debug: rlm_sqlcounter: Could not find Check item value pair Sat Jun 20 13:36:20 2015 : Info: ++[noresetcounter] returns noop Sat Jun 20 13:36:20 2015 : Debug: rlm_sqlcounter: Entering module authorize code Sat Jun 20 13:36:20 2015 : Debug: rlm_sqlcounter: Could not find Check item value pair Sat Jun 20 13:36:20 2015 : Info: ++[dailycounter] returns noop Sat Jun 20 13:36:20 2015 : Debug: rlm_sqlcounter: Entering module authorize code Sat Jun 20 13:36:20 2015 : Debug: rlm_sqlcounter: Could not find Check item value pair Sat Jun 20 13:36:20 2015 : Info: ++[monthlycounter] returns noop Sat Jun 20 13:36:20 2015 : Debug: rlm_sqlcounter: Entering module authorize code Sat Jun 20 13:36:20 2015 : Debug: rlm_sqlcounter: Could not find Check item value pair Sat Jun 20 13:36:20 2015 : Info: ++[testcounter] returns noop Sat Jun 20 13:36:20 2015 : Info: ++[expiration] returns noop Sat Jun 20 13:36:20 2015 : Info: ++[logintime] returns noop Sat Jun 20 13:36:20 2015 : Info: ++[pap] returns updated Please advice. Regards, Randeep On Sat, Jun 20, 2015 at 1:23 PM, Randeep <randeep123@gmail.com> wrote:
Hi,
I'm trying to set maximum data limit for a user.
In the /etc/raddb/sql/mysql/counter.conf
I have created this.
sqlcounter testcounter { counter-name = Max-Data-Used check-name = Max-Data sqlmod-inst = sql key = User-Name reset = daily reply-message = “You have reached your bandwidth limit” sqlmod-inst = sql query = “SELECT SUM(acctinputoctets) + SUM(acctoutputoctets) FROM radacct WHERE username=’%{%k}'” } }
When I checked the accounting flow, the flow is as follows,
New acct request -> Preacct ->accounting -> Send response
So I tried to put the testcounter in
/etc/raddb/sites-enabled/default
In preacct and accounting blocks.
But it gave me errors
Sat Jun 20 13:12:54 2015 : Error: /etc/raddb/sites-enabled/default[389]: "SQL Counter" modules aren't allowed in 'accounting' sections -- they have no such method. Sat Jun 20 13:12:54 2015 : Error: /etc/raddb/sites-enabled/default[382]: Errors parsing accounting section.
Also I'm confused about the parameters in the testcounter.
We have to declare these two variables anywhere? counter-name = Max-Data-Used check-name = Max-Data
Where we can specify the max data limit to the user.
Please advice. Also please give some links if you which I can refer.
-- Randeep Mob: +919447831699[kerala] Mob: +919880050349[B'lore] http://twitter.com/Randeeppr http://in.linkedin.com/in/randeeppr
-- Randeep Mob: +919447831699[kerala] Mob: +919880050349[B'lore] http://twitter.com/Randeeppr http://in.linkedin.com/in/randeeppr [image: --] Randeep Raman [image: http://]about.me/Randeeppr <http://about.me/Randeeppr>