FreeRadius 2.1.3 & SQL error
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
Hi,
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?
the details files - depends how you've configured your server! they would usually lurk in /var/log/radius/radacct - with each directory containing info from each NAS.
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?
supplied to you? Why not just read the examples and configurations that come with server (either grab the source code and check the files eg in raddb/sql/mysql/ these would show the sql_user_name = "%{User-Name}" bit and then the usage of eg accounting_start_query = " \ INSERT INTO ${acct_table1} \ (acctsessionid, acctuniqueid, username, \ realm, nasipaddress, nasportid, \ nasporttype, acctstarttime, acctstoptime, \ acctsessiontime, acctauthentic, connectinfo_start, \ connectinfo_stop, acctinputoctets, acctoutputoctets, \ calledstationid, callingstationid, acctterminatecause, \ servicetype, framedprotocol, framedipaddress, \ acctstartdelay, acctstopdelay, xascendsessionsvrkey) \ VALUES \ ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \ '%{NAS-Port-Type}', '%S', NULL, \ '0', '%{Acct-Authentic}', '%{Connect-Info}', \ '', '0', '0', \ '%{Called-Station-Id}', '%{Calling-Station-Id}', '', \ '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', \ alan
participants (2)
-
Alan Buxey -
Mike Diggins