Missing groupname in radacct table
Hi all, I've set the account query to include the groupname in radacct table but it expand the %{SQL-Group} to empty... any idea what i'm doing wrong? You can check the full configuration used for accounting in https://pastebin.com/dnEQRwUf But in resume i do: INSERT INTO ${....acct_table1} \ (${...column_list}) \ VALUES \ ('%{Acct-Session-Id}', \ '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ '%{SQL-Group}', \ '%{Realm}', \ ... In the log when authentication is done is see the group been set... But it inserts the groupname empty... (0) sql: Executing select query: SELECT groupname FROM radusergroup WHERE username = 'MyUSER' ORDER BY priority (0) sql: User found in the group table (0) sql: EXPAND SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = '%{SQL-Group}' ORDER BY id (0) sql: --> SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'group2' ORDER BY id (0) sql: Executing select query: SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'group2' ORDER BY id (0) sql: Group "group2": Conditional check items matched (0) sql: Group "group2": Merging assignment check items (0) sql: Simultaneous-Use := 100 (0) sql: EXPAND SELECT id, groupname, attribute, value, op FROM radgroupreply WHERE groupname = '%{SQL-Group}' ORDER BY id (0) sql: --> SELECT id, groupname, attribute, value, op FROM radgroupreply WHERE groupname = 'group2' ORDER BY id (0) sql: Executing select query: SELECT id, groupname, attribute, value, op FROM radgroupreply WHERE groupname = 'group2' ORDER BY id (0) sql: Group "group2": Merging reply items ... (1) sql: EXPAND INSERT INTO radacct (acctsessionid, acctuniqueid, username, groupname, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctupdatetime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{SQL-Group}', '%{Realm}', '%{NAS-IP-Address}', '%{%{NAS-Port-ID}:-%{NAS-Port}}', '%{NAS-Port-Type}', FROM_UNIXTIME(%{integer:Event-Timestamp}), FROM_UNIXTIME(%{integer:Event-Timestamp}), NULL, '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}') (1) sql: --> INSERT INTO radacct (acctsessionid, acctuniqueid, username, groupname, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctupdatetime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress) VALUES ('5971E477290A00', '3a3680e379da33a7ad1c8436a1f049ed', 'MyUSER', '', '', '127.0.1.1', '0', 'Async', FROM_UNIXTIME(1500636279), FROM_UNIXTIME(1500636279), NULL, '0', 'RADIUS', '', '', '0', '0', 'L2TP:telework_sol1', '', '', 'Framed-User', 'PPP', '192.168.10.200') (1) sql: Executing query: INSERT INTO radacct (acctsessionid, acctuniqueid, username, groupname, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctupdatetime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress) VALUES ('5971E477290A00', '3a3680e379da33a7ad1c8436a1f049ed', 'MyUSER', '', '', '127.0.1.1', '0', 'Async', FROM_UNIXTIME(1500636279), FROM_UNIXTIME(1500636279), NULL, '0', 'RADIUS', '', '', '0', '0', 'L2TP:telework_sol1', '', '', 'Framed-User', 'PPP', '192.168.10.200') -- Saludos / Regards / Cumprimentos, António silva
On Jul 21, 2017, at 7:29 AM, Antonio Silva <asilva@wirelessmundi.com> wrote:
I've set the account query to include the groupname in radacct table but it expand the %{SQL-Group} to empty... any idea what i'm doing wrong?
The SQL-Group is really only for checking users during authorization. It doesn't get copied to the accounting packets. Perhaps you could explain what you're trying to do... Alan DeKok.
just insert the the value in radacct table, this way i can check and extract data directly form this table to compute stats for groups. Ok, knowing this i can change my query to INSERT INTO ${....acct_table1} \ (${...column_list}) \ VALUES \ ('%{Acct-Session-Id}', \ '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ '(SELECT groupname FROM \${....usergroup_table} WHERE username='%{SQL-User-Name}' ORDER BY priority)', \ '%{Realm}', \ ... thanks. Saludos / Regards / Cumprimentos, António silva On 07/21/2017 01:40 PM, Alan DeKok wrote:
On Jul 21, 2017, at 7:29 AM, Antonio Silva <asilva@wirelessmundi.com> wrote:
I've set the account query to include the groupname in radacct table but it expand the %{SQL-Group} to empty... any idea what i'm doing wrong? The SQL-Group is really only for checking users during authorization. It doesn't get copied to the accounting packets.
Perhaps you could explain what you're trying to do...
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Alan DeKok -
Antonio Silva