freeradius- update radacct
Hello, I have freeradius virtual configurations. Until today all were working without a problem. But today i created a new one and i have a tiny problem about it. It doesnt update sql queries until the user logs off. SO i can not track the statistics of online users and transferred data etc via mysql. But as i see freeradius gets the following packets below in normal intervals And if it was an error about sql.conf i think it wont write the data when user disconnected too.It just does not update the online users data..and i wonder why..Seems like it does not create user data at the begining so it can not update the data too. ----------------------------------------------------------------- expand: INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctsessiontime, acctauthentic, connectinfo_start, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, servicetype, framedprotocol, framedipaddress, acctstartdelay, xascendsessionsvrkey) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S', INTERVAL (%{%{Acct-Session-Time}:-0} + %{%{Acct-Delay-Time}:-0}) SECOND), '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}', '%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{X-Ascend-Session-Svr-Key}') -> INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctsessiontime, acctauthentic, connectinfo_start, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, servicetype, framedprotocol, framedipaddress, acctstartdelay, xascendsessionsvrkey) VALUES ('4906e32a00000001', '83f3f3b94fce6dc1', '7798-1', '', '192.168.182.1', '1', 'Wireless-802.11', DATE_SUB('2008-10-28 13:01:21', INTERVAL (3401 + 0) SECOND), '3401', '', '', '0' << 32 | '34293752', '0' << 32 | '1270253', '00-0E-0C-6E-6E-7C', '00-14-22-A1-BB-AB', '', '', '192.168.182.2', '0', '') NAS-IP-Address = 192.168.182.1 -------------------------------------------------- This is the virtual config and sql.conf parameters i am using (which are same of the previous virtual servers actually) ------------------------- server lojnet { authorize { preprocess files update control { Auth-Type := perl } perl_lojnet } authenticate { Auth-Type Perl { perl_lojnet } } preacct { acct_unique files } accounting { detail unix sql_lojnet } session { sql_lojnet } post-auth { exec Post-Auth-Type REJECT { attr_filter.access_reject } } ----------------------------------- and the sql part belongs to this virtual server -------------------------------------- sql sql_lojnet { database = "mysql" driver = "rlm_sql_${database}" # Connection info: server = "xxxxxxxxx" login = "xxxxxxxxx" password = "xxxxxxxxxx" # Database table configuration for everything except Oracle radius_db = "lojnet" acct_table1 = "radacct" acct_table2 = "radacct" # Allow for storing data after authentication postauth_table = "radpostauth" authcheck_table = "radcheck" authreply_table = "radreply" groupcheck_table = "radgroupcheck" groupreply_table = "radgroupreply" # Table to keep group info usergroup_table = "usergroup" # If set to 'yes' (default) we read the group tables # If set to 'no' the user MUST have Fall-Through = Yes in the radreply table # read_groups = yes # Remove stale session if checkrad does not see a double login deletestalesessions = yes # Print all SQL statements when in debug mode (-x) sqltrace = no sqltracefile = ${logdir}/sqltrace.sql # number of sql connections to make to server num_sql_socks = 5 # number of seconds to dely retrying on a failed database # connection (per_socket) # number of seconds to dely retrying on a failed database # connection (per_socket) connect_failure_retry_delay = 60 #readclients = yes # Table to keep radius client info nas_table = "nas" # Read driver-specific configuration $INCLUDE sql/${database}/dialup.conf }
I have freeradius virtual configurations. Until today all were working without a problem. But today i created a new one and i have a tiny problem about it. It doesnt update sql queries until the user logs off. SO i can not track the statistics of online users and transferred data etc via mysql. But as i see freeradius gets the following packets below in normal intervals And if it was an error about sql.conf i think it wont write the data when user disconnected too.It just does not update the online users data..and i wonder why..Seems like it does not create user data at the begining so it can not update the data too.
If server doesn't get accounting start packet it will use alternative update query (INSERT) because there is nothing to update. That is if this is an update packet at all. You will need to post the request that was processed as well. If you are not getting updates from the NAS at all you need to fix that on the NAS or by sending Acct-Interim-Inetrval in the Access-Accept reply. No guarantee that your NAS will respect it. Ivan Kalik Kalik Informatika ISP
I have freeradius virtual configurations. Until today all were working without a problem. But today i created a new one and i have a tiny problem about it. It doesnt update sql queries until the user logs off. SO i can not track the statistics of online users and transferred data etc via mysql. But as i see freeradius gets the following packets below in normal intervals And if it was an error about sql.conf i think it wont write the data when user disconnected too.It just does not update the online users data..and i wonder why..Seems like it does not create user data at the begining so it can not update the data too.
If server doesn't get accounting start packet it will use alternative update query (INSERT) because there is nothing to update. That is if this is an update packet at all. You will need to post the request that was processed as well.
I am sending the debug mode ouput of a login-disconnect process from freeradius on the attachment.
If you are not getting updates from the NAS at all you need to fix that on the NAS or by sending Acct-Interim-Inetrval in the Access-Accept reply. No guarantee that your NAS will respect it.
Acct_Interim-Interval was set to 60 seconds for users.And i am receiving the update msgs too.I am using this NAS config with my other virtual radius servers too without any problem. And one more thing about this, as i see freeradius does not send connection or update packets as soon as it receives it, seems like it waits a while then sends all logs to mysql in a few mins.. Is there any config that i can change the update interval of mysql via freeradius?
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
I've got only a few lines of debug. Ivan Kalik Kalik Informatika ISP Dana 28/10/2008, "Oguzhan Kayhan" <oguzhank@bilkent.edu.tr> piše:
I have freeradius virtual configurations. Until today all were working without a problem. But today i created a new one and i have a tiny problem about it. It doesnt update sql queries until the user logs off. SO i can not track the statistics of online users and transferred data etc via mysql. But as i see freeradius gets the following packets below in normal intervals And if it was an error about sql.conf i think it wont write the data when user disconnected too.It just does not update the online users data..and i wonder why..Seems like it does not create user data at the begining so it can not update the data too.
If server doesn't get accounting start packet it will use alternative update query (INSERT) because there is nothing to update. That is if this is an update packet at all. You will need to post the request that was processed as well.
I am sending the debug mode ouput of a login-disconnect process from freeradius on the attachment.
If you are not getting updates from the NAS at all you need to fix that on the NAS or by sending Acct-Interim-Inetrval in the Access-Accept reply. No guarantee that your NAS will respect it.
Acct_Interim-Interval was set to 60 seconds for users.And i am receiving the update msgs too.I am using this NAS config with my other virtual radius servers too without any problem.
And one more thing about this, as i see freeradius does not send connection or update packets as soon as it receives it, seems like it waits a while then sends all logs to mysql in a few mins.. Is there any config that i can change the update interval of mysql via freeradius?
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
I have freeradius virtual configurations. Until today all were working without a problem. But today i created a new one and i have a tiny problem about it. It doesnt update sql queries until the user logs off. SO i can not track the statistics of online users and transferred data etc via mysql. But as i see freeradius gets the following packets below in normal intervals And if it was an error about sql.conf i think it wont write the data when user disconnected too.It just does not update the online users data..and i wonder why..Seems like it does not create user data at the begining so it can not update the data too.
If server doesn't get accounting start packet it will use alternative update query (INSERT) because there is nothing to update. That is if this is an update packet at all. You will need to post the request that was processed as well.
If you are not getting updates from the NAS at all you need to fix that on the NAS or by sending Acct-Interim-Inetrval in the Access-Accept reply. No guarantee that your NAS will respect it.
Ivan Kalik Kalik Informatika ISP
-
Ok found the problem.. Couldn't insert SQL accounting ALIVE record - Unknown column 'xascendsessionsvrkey' in 'field list' I forgot to add the field on radacct table.. Ok added and everything works fine.
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Oguzhan Kayhan -
tnt@kalik.net