Fisrt at all replace in sqlcounter.conf this line: sqlmod-inst = sqlcca3} whith this one: sqlmod-inst = sql
The usage statics are updated by rlm_sql. todo this you must have "sql" in the accounting section of your radiusd.conf Juan Pablo [EMAIL PROTECTED] dijo: > Hi All, > > I want to use RLM_SQLCOUNTER with Freeradius. > After compiling RLM_SQLCOUNTER with FreeRadius .. I still can't see > radius trying to update usage statistics in MYSQL tables. > I read doc/rlm_sqlcounter and thought whenever user uses any minutes out > of allocated values RLM_COUNTER will change statistics by calculating : > (Allocated time - Used time)= Remaining time. > Am I right here? Any help will be appreciated.... > > > Sqlcounter.conf : > sqlcounter dailycounter { > driver = "rlm_sqlcounter" > counter-name = Daily-Session-Time > check-name = Max-Daily-Session > sqlmod-inst = sqlcca3 > key = User-Name > reset = daily > query = "SELECT SUM(AcctSessionTime - GREATEST((%b - > UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' > AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'" > } > sqlcounter monthlycounter { > counter-name = Monthly-Session-Time > check-name = Max-Monthly-Session > sqlmod-inst = sqlcca3 > key = User-Name > reset = monthly > query = "SELECT SUM(AcctSessionTime - GREATEST((%b - > UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' > AND UNIX_TIMESTAMP(AcctStartTime) + > AcctSessionTime > '%b'" > } > > # Query: > # SELECT * > # FROM `radcheck` > # > 'id','UserName','Attribute','op','Value' > '[NULL]','infinite','Password','==','infinite' > '[NULL]','infinite','Max-Daily-Session',':=','100' > '[NULL]','infinite','Max-Monthly-Session',':=','1000' > > Radiusd -Xp 1645 returns.................... > --- Walking the entire request list --- > Cleaning up request 1 ID 67 with timestamp 405f32ea > Nothing to do. Sleeping until we see a request. > rad_recv: Accounting-Request packet from host 132.146.197.111:1646, > id=68, length=36 > User-Name = "infinite" > Acct-Status-Type = Stop > Processing the preacct section of radiusd.conf > modcall: entering group preacct for request 2 > modcall[preacct]: module "preprocess" returns noop for request 2 > rlm_realm: No '@' in User-Name = "infinite", looking up realm NULL > rlm_realm: No such realm "NULL" > modcall[preacct]: module "suffix" returns noop for request 2 > modcall[preacct]: module "files" returns noop for request 2 > modcall: group preacct returns noop for request 2 > Processing the accounting section of radiusd.conf > modcall: entering group accounting for request 2 > rlm_acct_unique: WARNING: Attribute NAS-Port was not found in request, > unique ID MAY be inconsistent > rlm_acct_unique: WARNING: Attribute Acct-Session-Id was not found in > request, unique ID MAY be inconsistent > rlm_acct_unique: Hashing ',Client-IP-Address > 132.146.197.111,NAS-IP-Address = 132.146.197.111,,User-Name = "i > nfinite"' > rlm_acct_unique: Acct-Unique-Session-ID = "e017b662ef57e3ce". > modcall[accounting]: module "acct_unique" returns ok for request 2 > radius_xlat: > '/usr/local/var/log/radius/radacct/132.146.197.111/detail-20040322' > rlm_detail: > /usr/local/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d > expands to /usr/local/var/log/ > radius/radacct/132.146.197.111/detail-20040322 > modcall[accounting]: module "detail" returns ok for request 2 > modcall[accounting]: module "unix" returns noop for request 2 > radius_xlat: '/usr/local/var/log/radius/radutmp' > radius_xlat: 'infinite' > rlm_radutmp: No NAS-Port seen. Cannot do anything. > rlm_radumtp: WARNING: checkrad will probably not work! > modcall[accounting]: module "radutmp" returns noop for request 2 > radius_xlat: 'infinite' > rlm_sql (sql): sql_set_user escaped user --> 'infinite' > radius_xlat: 'UPDATE radacct SET AcctStopTime = '2004-03-22 18:39:55', > AcctSessionTime = '', AcctInputOctets '', AcctOutputOctets = '', > AcctTerminateCause = '', AcctStopDelay = '', > ConnectInfo_stop = '' WHERE AcctSessio > nId = '' AND UserName = 'infinite' AND NASIPAddress = '132.146.197.111'' > rlm_sql (sql): Reserving sql socket id: 4 > rlm_sql (sql): Released sql socket id: 4 > modcall[accounting]: module "sql" returns ok for request 2 > modcall: group accounting returns ok for request 2 > Sending Accounting-Response of id 68 to 132.146.197.111:1646 > Finished request 2 > Going to the next request > --- Walking the entire request list --- > Cleaning up request 2 ID 68 with timestamp 405f32fb > Nothing to do. Sleeping until we see a request. > > > > > Regards, > Sagar > > > - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html