RE: sql counter clarification and issues
Hi all, Ok I've set it all up, it looks like it's working, when I look in the debug I see: Module: Instantiated sql (sql) Module: Loaded SQL Counter sqlcounter: counter-name = "Daily-Session-Time" sqlcounter: check-name = "Max-Daily-Session" sqlcounter: key = "User-Name" sqlcounter: sqlmod-inst = "sqlcca3" sqlcounter: query = "SELECT SUM(AcctSessionTime - GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'" sqlcounter: reset = "daily" rlm_sqlcounter: Counter attribute Daily-Session-Time is number 1671 rlm_sqlcounter: Check attribute Max-Daily-Session is number 1672 rlm_sqlcounter: Current Time: 1120445182 [2005-07-04 12:46:22], Next reset 1120485600 [2005-07-05 00:00:00] rlm_sqlcounter: Current Time: 1120445182 [2005-07-04 12:46:22], Prev reset 1120399200 [2005-07-04 00:00:00] Module: Instantiated sqlcounter (dailycounter) Module: Loaded Acct-Unique-Session-Id acct_unique: key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port" Module: Instantiated acct_unique (acct_unique) So I understand what it's meant to do: At midnight every night will it begin a new row in SQL ? So let's say that someone has maintained a connection all day, SQL will create a new row ? Am I understanding this correctly ? Because at the moment there are no new rows being created, no counters being reset. Cheers, thanks again. Regards, -- Ross -----Original Message----- From: freeradius-users-bounces@lists.freeradius.org [mailto:freeradius-users-bounces@lists.freeradius.org] On Behalf Of Alan DeKok Sent: Thursday, 30 June 2005 1:41 AM To: FreeRadius users mailing list Subject: Re: sql counter clarification and issues "Ross Tsolakidis" <Ross.Tsolakidis@day3.com.au> wrote:
Can you give me an example of how to set the counter to reset in SQL ?
No, I said "sqlcounter". It's a separate module. See "experimental.conf" Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
"Ross Tsolakidis" <Ross.Tsolakidis@day3.com.au> wrote:
At midnight every night will it begin a new row in SQL ?
I don't know, I've never used the module.
Because at the moment there are no new rows being created, no counters being reset.
Is the server receiving accounting packets? Run it in debug mode with "reset=hour", and spend some time looking at what it's doing. Alan DeKok.
participants (2)
-
Alan DeKok -
Ross Tsolakidis