SQL session start
Marcin
m.marszal at wp.pl
Fri Sep 13 18:25:00 CEST 2019
>
> Alan DeKok <aland at deployingradius.com> w dniu 13.09.2019, o godz. 15:02:
> So what's in SQL? Does the AcctUniqueId match?
Yes it does and no, it doesn’t. Most often, AcctUniqueId is inserted but sometimes not. And if it’s in table, sometimes not all columns in radacct table are updated. Affected are:
acctupdatetime acctstoptime acctinterval acctsessiontime connectinfo_stop acctinputoctets acctoutputoctets framedipaddress
> What was inserted into SQL when the Access-Accept was sent?
Inserted values are either NULL or „0” (in acctsessiontime, acctinputoctets and acctoutputoctets) - which reflects initial - postauth entry. So, I guess it’s right.
i.e. missing data in entry, which is not updated:
mysql> SELECT * FROM `radacct` WHERE `acctuniqueid` = 'fd2ad124f5dafc712c9865a3bb8b95af';
+-----------+------------------+----------------------------------+----------+-------+--------------+-----------+-----------------+---------------------+----------------+--------------+--------------+-----------------+---------------+-----------------------+------------------+-----------------+------------------+-----------------------+-------------------+--------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+
| radacctid | acctsessionid | acctuniqueid | username | realm | nasipaddress | nasportid | nasporttype | acctstarttime | acctupdatetime | acctstoptime | acctinterval | acctsessiontime | acctauthentic | connectinfo_start | connectinfo_stop | acctinputoctets | acctoutputoctets | calledstationid | callingstationid | acctterminatecause | servicetype | framedprotocol | framedipaddress | framedipv6address | framedipv6prefix | framedinterfaceid | delegatedipv6prefix |
+-----------+------------------+----------------------------------+----------+-------+--------------+-----------+-----------------+---------------------+----------------+--------------+--------------+-----------------+---------------+-----------------------+------------------+-----------------+------------------+-----------------------+-------------------+--------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+
| 2275 | 8FC4A77CA2F41209 | fd2ad124f5dafc712c9865a3bb8b95af | Kito | | 172.16.0.4 | NULL | Wireless-802.11 | 2019-09-13 13:44:50 | NULL | NULL | NULL | 0 | | CONNECT 0Mbps 802.11b | NULL | 0 | 0 | FK-EC-CA-88-FF-4D:Site | 10-87-35-81-FC-65 | NULL | Framed-User | NULL | | | | | |
+-----------+------------------+----------------------------------+----------+-------+--------------+-----------+-----------------+---------------------+----------------+--------------+--------------+-----------------+---------------+-----------------------+------------------+-----------------+------------------+-----------------------+-------------------+--------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+
1 row in set (0.00 sec)
Updated data:
mysql> SELECT * FROM `radacct` WHERE `acctuniqueid` = '549a0425b38d30407db45aa8ae9b0c35';
+-----------+------------------+----------------------------------+----------+-------+--------------+-----------+-----------------+---------------------+---------------------+---------------------+--------------+-----------------+---------------+-----------------------+-----------------------+-----------------+------------------+-----------------------+-------------------+--------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+
| radacctid | acctsessionid | acctuniqueid | username | realm | nasipaddress | nasportid | nasporttype | acctstarttime | acctupdatetime | acctstoptime | acctinterval | acctsessiontime | acctauthentic | connectinfo_start | connectinfo_stop | acctinputoctets | acctoutputoctets | calledstationid | callingstationid | acctterminatecause | servicetype | framedprotocol | framedipaddress | framedipv6address | framedipv6prefix | framedinterfaceid | delegatedipv6prefix |
+-----------+------------------+----------------------------------+----------+-------+--------------+-----------+-----------------+---------------------+---------------------+---------------------+--------------+-----------------+---------------+-----------------------+-----------------------+-----------------+------------------+-----------------------+-------------------+--------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+
| 2281 | C0A8033AB1FB6258 | 549a0425b38d30407db45aa8ae9b0c35 | Mark | | 172.16.0.5 | NULL | Wireless-802.11 | 2019-09-13 16:03:34 | 2019-09-13 16:03:34 | 2019-09-13 16:02:47 | 300 | 416 | | CONNECT 0Mbps 802.11b | CONNECT 0Mbps 802.11b | 4294967296 | 4294967296 | FK-EC-CA-88-FF-4D:Site | 78-FG-C7-99-D1-A6 | | Framed-User | NULL | 172.16.4.10 | | | | |
+-----------+------------------+----------------------------------+----------+-------+--------------+-----------+-----------------+---------------------+---------------------+---------------------+--------------+-----------------+---------------+-----------------------+-----------------------+-----------------+------------------+-----------------------+-------------------+--------------------+-------------+----------------+-----------------+-------------------+------------------+-------------------+---------------------+
1 row in set (0.00 sec)
Or empty:
mysql> SELECT * FROM `radacct` WHERE `acctuniqueid` = '6d2b000d2e24857d10699c46ad662bff';
Empty set (0.00 sec)
mysql>
In general, it seems like table is updated inconsistently. Since there are no any accounting errors when sql_session_start is disabled, I think it's must be related to that particular feature or maybe to mysql database itself?
More information about the Freeradius-Users
mailing list