Hi everybody,
I've been using sqlcounter with mysql for a while without a problem
(thanks to developers).
Now, I want to use it with an external database/table, I mean to check
the quota time from another personal table. As I undertand, it should
work by only specifying a new sql module, and pointing the sqlcounter's
sqlmod-inst into it.
However when try to do that, it does not work, the rlm_sqcounter steps
seem ok (cf. the part of log below in debug mod), but I do not find any
corresponding mysql query.
So, is it possible to do that ? If yes, what might be wrong in my config ?
Thanks in advance,
-- part of my config --
#
# Configuration for the SQL module.
#
sql sql_simrad {
# Database type
# Current supported are: rlm_sql_mysql, rlm_sql_postgresql,
rlm_sql_iodbc, rlm_sql_oracle
driver = "rlm_sql_mysql"
# Connect info
server = "ntp"
login = "myuser"
password = "mypassword"
# Database table configuration
radius_db = "simrad"
...
}
...
#
# sql counter configuration ...
sqlcounter sqlcounter_monthly_simrad {
counter-name = SQL-Monthly-Session-Time
check-name = SQL-Max-Monthly-Session-Time
sqlmod-inst = sql_simrad
key = User-Name
query = "SELECT SUM(SessionTime) FROM simacct WHERE
UserName='%{%k}'"
reset = monthly
}
-- here is the output of the radius server --
rlm_sqlcounter: Entering module authorize code
sqlcounter_expand: 'SELECT SUM(SessionTime) FROM simacct WHERE
UserName='%{User-Name}''
radius_xlat: 'SELECT SUM(SessionTime) FROM simacct WHERE
UserName='do-risika''
sqlcounter_expand: '%{sql_simrad:SELECT SUM(SessionTime) FROM simacct
WHERE UserName='do-risika'}'
radius_xlat: ''
rlm_sqlcounter: (Check item - counter) is greater than zero
rlm_sqlcounter: Authorized user do-risika, check_item=108000, counter=0
rlm_sqlcounter: Sent Reply-Item for user do-risika,
Type=Session-Timeout, value=108000
modcall[authorize]: module "sqlcounter_monthly_simrad" returns ok
@+
--
DouRiX \\\|///
___ \\ - - // ____ ___ __
| _ oOOo_@ @_oOOo| _ \(_) \/ /
| | | |/ _(_) | | | |_| ) |\ /
| |_| | (_) | |_| | _ <| |/ \
|____/ \___/ \_Ooooo| \_\_/_/\_\
f u cn rd ths u r usng unx
ooooO ) /
( ) (_/
\ (
\_)
[Stupid questions are better than
stupid mistakes. --Japanese proverb]
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html