Accounting mysql

nicolas.clo at ricoh-industrie.fr nicolas.clo at ricoh-industrie.fr
Wed Sep 2 08:54:59 CEST 2015



Hi List,
I have a problem to log accounting informations to mysql,

rlm_sql_mysql: ERROR 1582 (Incorrect parameter count in the call to native function
'FROM_UNIXTIME'): 42000

It seems to be that Freeradius can't retrieve "integer:Event-Timestamp" value.

 FreeRADIUS Version 3.0.10 (git #f7065a7), for host i486-pc-linux-gnu, built on Sep  1 2015 at
15:39:31 on Debian 7.8
Mysql 5.5.35

Wed Sep  2 08:38:21 2015 : Debug: INSERT INTO radacct (acctsessionid,           acctuniqueid,
username, 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}', '%{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}')
Wed Sep  2 08:38:21 2015 : Debug: Parsed xlat tree:
Wed Sep  2 08:38:21 2015 : Debug: literal --> INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,                        nasipaddress,           nasportid,
nasporttype,acctstarttime,          acctupdatetime, acctstoptime,           acctsessiontime,
acctauthentic, connectinfo_start,       connectinfo_stop,       acctinputoctets, acctoutputoctets,
calledstationid,       callingstationid, acctterminatecause,   servicetype,
framedprotocol, framedipaddress) VALUES ('
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Acct-Session-Id
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Acct-Unique-Session-Id
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> SQL-User-Name
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Realm
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> NAS-IP-Address
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: if {
Wed Sep  2 08:38:21 2015 : Debug:       attribute --> NAS-Port-Id
Wed Sep  2 08:38:21 2015 : Debug: }
Wed Sep  2 08:38:21 2015 : Debug: else {
Wed Sep  2 08:38:21 2015 : Debug:       attribute --> NAS-Port
Wed Sep  2 08:38:21 2015 : Debug: }
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> NAS-Port-Type
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', FROM_UNIXTIME(
Wed Sep  2 08:38:21 2015 : Debug: xlat --> integer
Wed Sep  2 08:38:21 2015 : Debug: {
Wed Sep  2 08:38:21 2015 : Debug:       literal --> Event-Timestamp
Wed Sep  2 08:38:21 2015 : Debug: }
Wed Sep  2 08:38:21 2015 : Debug: literal --> ), FROM_UNIXTIME(
Wed Sep  2 08:38:21 2015 : Debug: xlat --> integer
Wed Sep  2 08:38:21 2015 : Debug: {
Wed Sep  2 08:38:21 2015 : Debug:       literal --> Event-Timestamp
Wed Sep  2 08:38:21 2015 : Debug: }
Wed Sep  2 08:38:21 2015 : Debug: literal --> ), NULL, '0', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Acct-Authentic
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Connect-Info
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '', '0', '0', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Called-Station-Id
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Calling-Station-Id
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Service-Type
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Framed-Protocol
Wed Sep  2 08:38:21 2015 : Debug: literal --> ', '
Wed Sep  2 08:38:21 2015 : Debug: attribute --> Framed-IP-Address
Wed Sep  2 08:38:21 2015 : Debug: literal --> ')
Wed Sep  2 08:38:21 2015 : Debug: (10) sql: EXPAND INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, 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}', '%{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}')
Wed Sep  2 08:38:21 2015 : Debug: (10) sql:    --> INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,                        nasipaddress,           nasportid,
nasporttype,acctstarttime,          acctupdatetime, acctstoptime,           acctsessiontime,
acctauthentic, connectinfo_start,       connectinfo_stop,       acctinputoctets, acctoutputoctets,
calledstationid,       callingstationid, acctterminatecause,   servicetype,
framedprotocol, framedipaddress) VALUES ('00000028', '', 'Administrateur', '', '172.29.x.x', '284',
'Wireless-802.11', FROM_UNIXTIME(), FROM_UNIXTIME(), NULL, '0', 'RADIUS', '', '', '0', '0',
'00xxxxxxxx', 'xxxxxxxxxxx', '', 'Framed-User', '', '')
Wed Sep  2 08:38:21 2015 : Debug: (10) sql: Executing query: INSERT INTO radacct (acctsessionid,
acctuniqueid,           username, realm,                        nasipaddress,           nasportid,
nasporttype,                acctstarttime,          acctupdatetime, acctstoptime,
acctsessiontime,        acctauthentic, connectinfo_start,       connectinfo_stop,
acctinputoctets, acctoutputoctets,     calledstationid,        callingstationid, acctterminatecause,
servicetype,            framedprotocol, framedipaddress) VALUES ('00000028', '', 'Administrateur',
'', '172.29.x.x', '284', 'Wireless-802.11', FROM_UNIXTIME(), FROM_UNIXTIME(), NULL, '0', 'RADIUS',
'', '', '0', '0', 'xxxxxxxxxxxxx', 'xxxxxxxxxxxxxx', '', 'Framed-User', '', '')
Wed Sep  2 08:38:21 2015 : Debug: rlm_sql_mysql: No additional diagnostic info on server
Wed Sep  2 08:38:21 2015 : ERROR: (10) sql: rlm_sql_mysql: ERROR 1582 (Incorrect parameter count in
the call to native function 'FROM_UNIXTIME'): 42000
Wed Sep  2 08:38:21 2015 : Debug: (10) sql: SQL query returned: server error
Wed Sep  2 08:38:21 2015 : Debug: rlm_sql (sql): Released connection (6)
Wed Sep  2 08:38:21 2015 : Debug: (10)     modsingle[accounting]: returned from sql (rlm_sql) for
request 10
Wed Sep  2 08:38:21 2015 : Debug: (10)     [sql] = fail
Wed Sep  2 08:38:21 2015 : Debug: (10)   } # accounting = fail
Wed Sep  2 08:38:21 2015 : Debug: (10) Not sending reply to client.
Wed Sep  2 08:38:21 2015 : Debug: (10) Finished request
                                                                   
       Any ideas ?                                                 
                                                                   
                                                                   
       Thanks.                                                     
                                                                   
                                                                   
       Nicolas.                                                    
                                                                   


More information about the Freeradius-Users mailing list