Hi, I've noticed that the acctstarttime on radacct table have some values I don't understand. In fact I have some routers (I work with mikrotik and hotspot + freeradius) that are in Taiwan and others on Spain. I thought that acctstarttime was set according the date time from the system where is installed freeradius (centos + mariadb for me) But I've seen today some rows from today (according radacctid) with a different time stamp (1970-04-13): I had an incorrect date on the mikrotik from the example, just the same date that is on the database, so then I thought that the acctstartime comes from router clock. but the routers I have In Taiwan with Taiwan clock don't save on accstarttime the router clock, they still saving data according the system where I have installed freeradius. What do I miss ? Thanks, Oscar.
On Mar 24, 2018, at 7:06 PM, Oscar Jofre <oscar@jofre.com> wrote:
I thought that acctstarttime was set according the date time from the system where is installed freeradius (centos + mariadb for me)
No. Acct-Start-Time is sent by the NAS. FreeRADIUS just writes it in the DB.
But I've seen today some rows from today (according radacctid) with a different time stamp (1970-04-13):
Because the time on the NAS is wrong.
I had an incorrect date on the mikrotik from the example, just the same date that is on the database,
Exactly.
so then I thought that the acctstartime comes from router clock.
It comes from the NAS.
but the routers I have In Taiwan with Taiwan clock don't save on accstarttime the router clock, they still saving data according the system where I have installed freeradius.
The NAS sends the time to FreeRADIUS as a 32-bit number. NOT as a printable string. And there's no time zone information. FreeRADIUS takes this time, converts it to a string, and writes it to the DB. So if both the NAS and FreeRADIUS use NTP for the correct time, they should have the same time. Alan DeKok.
Thanks Alan, So just for clarify: So if both the NAS and FreeRADIUS use NTP for the correct time, they should have the same time. In Taiwan’s NAS I have NTP and the NAS clock is 2018-03-25 07:29:16 am And when a write on radius comes from that router it saves as 2018-03-25 00:29:16 am ... the time from the centos where is installed freeradius. So if the NAS have an incorrect time (could not sync with NTP) will save an incorrect time on raddact ? Thanks, -----Mensaje original----- De: Freeradius-Users <freeradius-users-bounces+oscar=jofre.com@lists.freeradius.org> En nombre de Alan DeKok Enviado el: domingo, 25 de marzo de 2018 0:13 Para: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Asunto: Re: Radius acctstarttime On Mar 24, 2018, at 7:06 PM, Oscar Jofre < <mailto:oscar@jofre.com> oscar@jofre.com> wrote:
I thought that acctstarttime was set according the date time from the
system where is installed freeradius (centos + mariadb for me)
No. Acct-Start-Time is sent by the NAS. FreeRADIUS just writes it in the DB.
But I've seen today some rows from today (according radacctid) with a
different time stamp (1970-04-13):
Because the time on the NAS is wrong.
I had an incorrect date on the mikrotik from the example, just the
same date that is on the database,
Exactly.
so then I thought that the acctstartime comes from router clock.
It comes from the NAS.
but the routers I have In Taiwan with Taiwan clock don't save on
accstarttime the router clock, they still saving data according the
system where I have installed freeradius.
The NAS sends the time to FreeRADIUS as a 32-bit number. NOT as a printable string. And there's no time zone information. FreeRADIUS takes this time, converts it to a string, and writes it to the DB. So if both the NAS and FreeRADIUS use NTP for the correct time, they should have the same time. Alan DeKok. - List info/subscribe/unsubscribe? See <http://www.freeradius.org/list/users.html> http://www.freeradius.org/list/users.html
On Mar 24, 2018, at 7:34 PM, Oscar Jofre <oscar@jofre.com> wrote:
So if both the NAS and FreeRADIUS use NTP for the correct time, they should have the same time.
Yes.
And when a write on radius comes from that router it saves as 2018-03-25 00:29:16 am ... the time from the centos where is installed freeradius.
Not exactly. The time is ALWAYS taken from what the NAS sends. Please don't confuse the issue by thinking of it as the time from the RADIUS server. It *might* be the same time. But it is *not* the time taken from the RADIUS server.
So if the NAS have an incorrect time (could not sync with NTP) will save an incorrect time on raddact ?
That's what I said. Alan DeKok.
Hi, Sorry again .. but when you say:
The time is ALWAYS taken from what the NAS sends. Please don't confuse the issue by thinking of it as the time from the RADIUS server. It *might* be the same time. But it is *not* the time taken from the RADIUS server.
When i get an Accounting from NAS from Taiwan i get saved on the FreeRadius from SPAIN the Spanish time not the Time coming from the Taiwan NAS. Example: NAS Taiwan's Time clock is 2018-03-25 07:29:16 am and saved on data base 2018-03-25 00:29:16 am I understand, as you try to explain me (sorry i don't get it), that this exemple should do: NAS Taiwan's Time clock is 2018-03-25 07:29:16 am and saved on data base 2018-03-25 07:29:16 am But it doen not. Thanks -----Mensaje original----- De: Freeradius-Users <freeradius-users-bounces+oscar=jofre.com@lists.freeradius.org> En nombre de Alan DeKok Enviado el: domingo, 25 de marzo de 2018 1:05 Para: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Asunto: Re: Radius acctstarttime On Mar 24, 2018, at 7:34 PM, Oscar Jofre <oscar@jofre.com> wrote:
So if both the NAS and FreeRADIUS use NTP for the correct time, they should have the same time.
Yes.
And when a write on radius comes from that router it saves as 2018-03-25 00:29:16 am ... the time from the centos where is installed freeradius.
Not exactly. The time is ALWAYS taken from what the NAS sends. Please don't confuse the issue by thinking of it as the time from the RADIUS server. It *might* be the same time. But it is *not* the time taken from the RADIUS server.
So if the NAS have an incorrect time (could not sync with NTP) will save an incorrect time on raddact ?
That's what I said. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Mar 24, 2018, at 9:15 PM, Oscar Jofre <oscar@jofre.com> wrote:
Sorry again .. but when you say:
The same thing repeatedly, I would hope that my message gets across.
Example:
NAS Taiwan's Time clock is 2018-03-25 07:29:16 am and saved on data base 2018-03-25 00:29:16 am
You are aware of time zones, right? a) yes, the answer is clear b) no, go read up on how time zones work.
I understand, as you try to explain me (sorry i don't get it), that this exemple should do:
NAS Taiwan's Time clock is 2018-03-25 07:29:16 am and saved on data base 2018-03-25 07:29:16 am
No.
But it doen not.
Exactly. Alan DeKok.
participants (3)
-
Alan DeKok -
Michael Markstaller -
Oscar Jofre