Hey, In my FR1.1.7 setup, I have different realms for the same machine using different databases for each. The login part is ok, as well as the accounting, which has entries in the radacct table for "account". I enabled one of the sql counters modules which, as it seems, isn't returning any results, because I am suspecting that it's running the query on another realm's database. I have several of the sql.conf config files for each realm, so what I'm basically doing is having in accounting {} section something like this: Acct-Type SQL_EXAMPLE { sql_example } What do you think is happening? Here is the relevant debug snippet from freeradius: Wed May 6 22:47:28 2009 : Debug: modsingle[authorize]: calling accessperiod (rlm_sqlcounter) for request 0 Wed May 6 22:47:28 2009 : Debug: rlm_sqlcounter: Entering module authorize code Wed May 6 22:47:28 2009 : Debug: sqlcounter_expand: 'SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '%{Stripped-User-Name:-%{User-Name}}' ORDER BY AcctStartTime LIMIT 1' Wed May 6 22:47:28 2009 : Debug: radius_xlat: 'SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = 'access1' ORDER BY AcctStartTime LIMIT 1' Wed May 6 22:47:28 2009 : Debug: sqlcounter_expand: '%{sql:SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = 'access1' ORDER BY AcctStartTime LIMIT 1}' Wed May 6 22:47:28 2009 : Debug: radius_xlat: Running registered xlat function of module sql for string 'SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = 'access1' ORDER BY AcctStartTime LIMIT 1' Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): - sql_xlat Wed May 6 22:47:28 2009 : Debug: radius_xlat: 'access1' Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): sql_set_user escaped user --> 'access1' Wed May 6 22:47:28 2009 : Debug: radius_xlat: 'SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = 'access1' ORDER BY AcctStartTime LIMIT 1' Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): Reserving sql socket id: 2 Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): SQL query did not return any results Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): Released sql socket id: 2 Wed May 6 22:47:28 2009 : Debug: radius_xlat: '' Wed May 6 22:47:28 2009 : Debug: rlm_sqlcounter: (Check item - counter) is greater than zero Wed May 6 22:47:28 2009 : Debug: rlm_sqlcounter: Authorized user access1, check_item=300, counter=0 Wed May 6 22:47:28 2009 : Debug: rlm_sqlcounter: Sent Reply-Item for user access1, Type=Session-Timeout, value=300 Wed May 6 22:47:28 2009 : Debug: modsingle[authorize]: returned from accessperiod (rlm_sqlcounter) for request 0 Wed May 6 22:47:28 2009 : Debug: modcall[authorize]: module "accessperiod" returns ok for request 0 Regards, Liran.
Hey,
In my FR1.1.7 setup, I have different realms for the same machine using different databases for each. The login part is ok, as well as the accounting, which has entries in the radacct table for "account".
I enabled one of the sql counters modules which, as it seems, isn't returning any results, because I am suspecting that it's running the query on another realm's database. I have several of the sql.conf config files for each realm, so what I'm basically doing is having in accounting {} section something like this: Acct-Type SQL_EXAMPLE { sql_example }
What do you think is happening?
sqlcounter module has a config item sqlmod-inst which selects sql instance (database connection) that counter should use. Are you using the correct instance for that counter? Ivan Kalik Kalik Informatika ISP
You're correct, I haven't noticed this parameter and it's default 'sql' is a different database setup indeed. Thanks, Liran. On Wed, May 6, 2009 at 11:16 PM, Ivan Kalik <tnt@kalik.net> wrote:
Hey,
In my FR1.1.7 setup, I have different realms for the same machine using different databases for each. The login part is ok, as well as the accounting, which has entries in the radacct table for "account".
I enabled one of the sql counters modules which, as it seems, isn't returning any results, because I am suspecting that it's running the query on another realm's database. I have several of the sql.conf config files for each realm, so what I'm basically doing is having in accounting {} section something like this: Acct-Type SQL_EXAMPLE { sql_example }
What do you think is happening?
sqlcounter module has a config item sqlmod-inst which selects sql instance (database connection) that counter should use. Are you using the correct instance for that counter?
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Ivan Kalik -
liran tal