FreeRadius 2.1.3 & SQL error

Mike Diggins mike.diggins at mcmaster.ca
Fri Feb 26 19:55:51 CET 2010


First question, is the only way to get Accounting data from FreeRadius
by using one of the supported databases (like msql)? Is there no way to
just cut records to a text file or, ideally, syslog?

Second question: I inserted the following sql configuration (supplied to
me) into sql.conf but when I start FR, it errors out with this message.
Can someone tell me what is wrong?

including configuration file /usr/local/freeradius/etc/raddb/sql.conf
/usr/local/freeradius/etc/raddb/sql.conf[13]: Invalid expansion:
'%{User-Name}',\
Errors reading /usr/local/freeradius/etc/raddb/radiusd.conf



############################
# MySQL settings for accounting
############################
sql {
	driver = "rlm_sql_mysql"
	server = "localhost"
	login = "<user_for_mysql>"
	password = "<password_for_mysql>"
	radius_db = "radius"

	accounting_start_query = "INSERT into ACCOUNTING SET\
		`User-Name` = '%{User-Name}',\
		`Calling-Station-Id` = '%{Calling-Station-Id}',\
		`Called-Station-Id` = '%{Called-Station-Id}',\
		`NAS-IP-Address` = '%{NAS-IP-Address}',\
		`NAS-Port` = %{NAS-Port},\
		`Timestamp Start` = NOW(),\
		`Acct-Unique-Session-Id` = '%{Acct-Unique-Session-Id}'
	"

	accounting_update_query = "UPDATE ACCOUNTING SET\
		`Acct-Session-Time` = '%{Acct-Session-Time}',\
		`Acct-Input-Octets` = '%{Acct-Input-Octets}',\
		`Acct-Output-Octets` = '%{Acct-Output-Octets}',\
		`Acct-Input-Packets` = '%{Acct-Input-Packets}',\
		`Acct-Output-Packets` = '%{Acct-Output-Packets}'\
	WHERE `Acct-Unique-Session-Id` = '%{Acct-Unique-Session-Id}'\
	LIMIT 1
	"

	accounting_stop_query = "UPDATE ACCOUNTING SET\
		`Timestamp Stop` = NOW(),\
		`Acct-Session-Time` = '%{Acct-Session-Time}',\
		`Acct-Input-Octets` = '%{Acct-Input-Octets}',\
		`Acct-Output-Octets` = '%{Acct-Output-Octets}',\
		`Acct-Input-Packets` = '%{Acct-Input-Packets}',\
		`Acct-Output-Packets` = '%{Acct-Output-Packets}',\
		`Acct-Terminate-Cause` = '%{Acct-Terminate-Cause}'\
	WHERE `Acct-Unique-Session-Id` = '%{Acct-Unique-Session-Id}'\
	LIMIT 1
	"
}

-Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mike_diggins.vcf
Type: text/x-vcard
Size: 329 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20100226/a1e3eb76/attachment.vcf>


More information about the Freeradius-Users mailing list