Incorrect datetime issue

Somanath Mishra somanath.mishra at planetsbrain.com
Thu Sep 13 13:34:32 CEST 2018


Hi,

 i am facing issue in radacct insert. So it is showing incorrect dattime.
So in debug i found datetime cloumn is missing  'FROM_UNIXTIME' in debug
o/p . Below you can see debug msg.

---------------------------------------------------------------------
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}', (%{%{integer:Event-Timestamp}:-strftime('%%s',
'now')} - %{%{Acct-Session-Time}:-0}),

 %{%{integer:Event-Timestamp}:-date('now')}, NULL,
%{%{Acct-Session-Time}:-NULL}, '%{Acct-Authentic}', '%{Connect-Info}',
'',
 %{%{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}')
(16) 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
('3C00A8C0-0002A0D8', '40c3d442406733f6f19fe4fb3da8211c', 'bob', '',
'192.168.0.4', '0',
'Wireless-802.11', (1536835611 - 600), 1536835611, NULL, 600, 'RADIUS',
'CONNECT Unknown Radio', '', 0 << 32 | 155655, 0 << 32 | 434058,
'00:0c:29:67:6d:ec',
'18:f0:e4:b0:fe:fd', '', '', '', '192.168.0.60')

----------------------------------------------------------------------
but in insert stmt query looking ok. below is insert stmt query.



query = "\
                                INSERT INTO ${....acct_table1} \
                                        (${...column_list}) \
                                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}')"

                        #


So i am not able to understand where is the issue?
Can you help me on that?





More information about the Freeradius-Users mailing list