Missing groupname in radacct table

Antonio Silva asilva at wirelessmundi.com
Fri Jul 21 13:29:28 CEST 2017


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



More information about the Freeradius-Users mailing list