syslog not UTC

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
sgkrewe
DD-WRT Novice


Joined: 31 Jan 2020
Posts: 3

PostPosted: Wed Jun 09, 2021 4:51    Post subject: syslog not UTC Reply with quote
Router: Netgear R6700v3
Firmware: DD-WRT v3.0-r46885 std (06/05/21)
I've reviewed:
https://svn.dd-wrt.com/ticket/5913
https://wiki.dd-wrt.com/wiki/index.php/Network_Time_Protocol

I'm OK with my syslog being UTC. But it's not. It's UTC+2 or basically the time in Germany.

My router time is correct at the top-right. I've tried different Time Zone settings (US/Central or US/Eastern) which shouldn't affect the syslog times and they don't.

I've tried Time Settings->Server IP/Name as blank or with ntp2.usno.navy.mil. Either way sets the correct router time (local to me) and has no affect on syslog entry times (other than giving them the correct date and UTC+2 and not Jan 1 01:00). syslog is showing "cyclic NTP Update success" so I am talking to ntp2.usno.navy.mil properly. Like I said the router time gets set properly.

Didn't Enable time settings prior to updating to this firmware build, so not sure if it was like this prior to this build.

Any ideas on how to see syslog entries as UTC and not UTC+2?
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6388
Location: UK, London, just across the river..

PostPosted: Wed Jun 09, 2021 12:47    Post subject: Reply with quote
what i will suggest is, use the numerical value of NTP time servers instead of resolving name...
also if you are in Germany select, time zone either Germany or Berlin...and ect. for other zones if so..

This is the clouflare NTP time IP, use it instead, put it in the NTP time box

162.159.200.123

i just checked my syslog NTP time is fine, so you are doing something wrong...or show us your syslog output, after you do those settings i recommended to you...and reboot...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,AP Isolation,Ad-Block,Firewall
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear R7800 --DD-WRT 55363 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55363 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
sgkrewe
DD-WRT Novice


Joined: 31 Jan 2020
Posts: 3

PostPosted: Wed Jun 09, 2021 15:17    Post subject: Reply with quote
*Trying Etc/GMT timezones instead of US/Central or America/Chicago

Set Time Server IP to 162.159.200.123

Set Time Zone in GUI to Etc/GMT-5
root@DDWRT101:/tmp# cat TZ
<+05>-5
Clock gets set to 19:27 (my local time is 09:27)
Syslog logs show 19:27 (UTC is 14:27, so this is like UTC+5)
Full syslog messages attached below (from after the reboot).

Set Time Zone in GUI to Etc/GMT+5 just out of curiosity
root@DDWRT101:/tmp# cat TZ
<-05>5
Clock gets set to 09:37 (matching my local time but why with GMT+5?)
Syslog logs show 19:37 still (UTC is 14:37 currently)
Did not reboot. Messages not attached for GMT+5 test.

Relevant portion after reboot:
Jan 1 05:00:17 DDWRT101 daemon.debug ntpclient[1383]: Connecting to 162.159.200.123 [162.159.200.123] ...
Jun 9 19:27:32 DDWRT101 daemon.info ntpclient[1383]: Time set from 162.159.200.123 [162.159.200.123].
Jun 9 19:27:32 DDWRT101 daemon.info process_monitor[1382]: cyclic NTP Update success (servers 162.159.200.123)

Still not sure what I could be doing wrong. All I've really tried to do was Enable NTP Client. Add my correct Time Zone. And then choose some different options for a Time Server including leaving it blank, or setting it to ntp2.usno.navy.mil or to 162.159.200.123.

Just set Time Zone in GUI to America/Chicago and rebooted.
TZ=CST6CDT,M3.2.0,M11.1.0
Dec 31 18:00:17 DDWRT101 daemon.debug ntpclient[1383]: Connecting to 162.159.200.123 [162.159.200.123] ...
Jun 9 10:01:32 DDWRT101 daemon.info ntpclient[1383]: Time set from 162.159.200.123 [162.159.200.123].
Jun 9 10:01:32 DDWRT101 daemon.info process_monitor[1382]: cyclic NTP Update success (servers 162.159.200.123)

Router time is 10:01 (which matches local time of the time zone)
Syslog logs also show time in local time zone time?!?! Not UTC, not UTC+2.

I'm scratching my head how syslog is now local time.



messages.txt
 Description:
/tmp/var/log/messages

Download
 Filename:  messages.txt
 Filesize:  9.31 KB
 Downloaded:  89 Time(s)

Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6388
Location: UK, London, just across the river..

PostPosted: Wed Jun 09, 2021 16:10    Post subject: Reply with quote
yep i suspect there is a something oddy with, selecting + 1,2,3,4 H , instead of NTP town its been like that for a long time and its due to some odd error...im glad you sorted the issue for yourself...as log as you find the best medium and your happy its fine... Razz
_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,AP Isolation,Ad-Block,Firewall
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear R7800 --DD-WRT 55363 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55363 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14102
Location: Texas, USA

PostPosted: Wed Jun 09, 2021 16:25    Post subject: Reply with quote
The complaint was that syslog wasn't local time, and it was a complaint by someone who doesn't understand UNIX time or that (Linux) kernel time is always UTC. There are time zone options in the webUI which are broken and have not been updated AFAIK. It is best to choose your location; It may not be the one you think it is (caveat); what exactly is your time zone?
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
sgkrewe
DD-WRT Novice


Joined: 31 Jan 2020
Posts: 3

PostPosted: Sat Jun 12, 2021 20:12    Post subject: Reply with quote
Figured out what's going on, at least for my router/firmware build combo.

In the WebGUI, Setup->Basic Setup, if you click "Apply Settings", it will change your router time to whatever timezone you select, but it won't change syslog logs as syslogd does not get restarted. If you reboot, then all of a sudden syslog logs are now whatever timezone you selected.

I dropped down to command-line and syslogd (again in my case) is started with the -L and -Z options by default (I haven't made any custom startup scripts). I played around with these and just restarted syslogd manually. The -Z option is what makes your syslog logs local time. Remove the -Z and your logs will be in UTC.

This leads me to two further questions, but out of scope of this original post. I'll create new posts in the forums at a later date. But for now I will say, if you change your time zone and wish your syslog logs to follow the change, then "Apply Settings" won't cut it, you will need to reboot the router (if you remain in the WebGUI, or if on command-line, just restart syslogd).
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum