How to store session info in external database?
Hi, I would like to store freeradius session information like Acct-Session-Id, Acct-Start-Time, Acct-Stop-Time, Acct-Input-Octets, Acct-Output-Octets, Framed-IP-Address, NAS-IP-Address in external database. We have our devices connected to databases which are readonly so we cannot store those informations there. Also we have database where we want to store session statistics from all devices. Is that possible to achieve ? Till now we tried setting up virtual host with Auth-Type rules redirecting to script but we cannot receive Acct-Session-Id. Here is how our /etc/freeradius/sites-avaliable/default looks like: authorize { chap mschap sql update control { Auth-Type := `/etc/freeradius/bin/testradius '%{User-Name}' '%{Calling-Station-Id}' '%{NAS-IP-Address}' '%{reply:Framed-IP-Address}' '%{reply:Acct-Session-Id}' '%{reply:Acct-Unique-Session-Id}'` } } authenticate { Auth-Type PAP { pap } Auth-Type CHAP { chap } Auth-Type MS-CHAP { mschap } } preacct { acct_unique } accounting { # sql } session { # sql } post-auth { # sql } Sorry for any language mistakes :) -- Pozdrawiam Maciej Lew tel. 883-376-062
Hi,
Hi, I would like to store freeradius session information like Acct-Session-Id, Acct-Start-Time, Acct-Stop-Time, Acct-Input-Octets, Acct-Output-Octets, Framed-IP-Address, NAS-IP-Address in external database.
the defauly config does this - you just need to edit the SQL module to be appropriate to your database (and have a DB you can write to!) and then use the 'sql' option in the accounting section (thats the section that will have those details as they are in RADIUS Accounting packets).
accounting { # sql }
look. there. to optimise you might then want to look at other virtual servers to do this stuff like bufferedsql or the remote accounting proxy one.....and then make sure your DB is optimised....both running environment (memory allocation, disk platters etc) , the table indexes and the DB engine used for the tables. alan
The problem is we have databases in slave mode, only reading is allowed. We want pass these informations to another database... 2013/8/6 <A.L.M.Buxey@lboro.ac.uk>
Hi,
Hi, I would like to store freeradius session information like Acct-Session-Id, Acct-Start-Time, Acct-Stop-Time, Acct-Input-Octets, Acct-Output-Octets, Framed-IP-Address, NAS-IP-Address in external database.
the defauly config does this - you just need to edit the SQL module to be appropriate to your database (and have a DB you can write to!) and then use the 'sql' option in the accounting section (thats the section that will have those details as they are in RADIUS Accounting packets).
accounting { # sql }
look. there.
to optimise you might then want to look at other virtual servers to do this stuff like bufferedsql or the remote accounting proxy one.....and then make sure your DB is optimised....both running environment (memory allocation, disk platters etc) , the table indexes and the DB engine used for the tables.
alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Pozdrawiam Maciej Lew tel. 883-376-062
Maciej Lew wrote:
The problem is we have databases in slave mode, only reading is allowed. We want pass these informations to another database...
Then configure another SQL module to talk to another database. There's no magic here. If you want to write to a database, configure the server to talk to a writable database. Alan DeKok.
On 6 Aug 2013, at 14:29, Maciej Lew <maciek@lanserver.pl> wrote:
The problem is we have databases in slave mode, only reading is allowed. We want pass these informations to another database...
Modules can have multiple instances. sql.conf -------- sql sql_write { <sql config> } accounting { sql_write } -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
Thanks, it works. 2013/8/6 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
On 6 Aug 2013, at 14:29, Maciej Lew <maciek@lanserver.pl> wrote:
The problem is we have databases in slave mode, only reading is allowed. We want pass these informations to another database...
Modules can have multiple instances.
sql.conf --------
sql sql_write { <sql config> }
accounting { sql_write }
-Arran
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Pozdrawiam Maciej Lew tel. 883-376-062
participants (4)
-
A.L.M.Buxey@lboro.ac.uk -
Alan DeKok -
Arran Cudbard-Bell -
Maciej Lew