How to UTC graphs ?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
choefing
Posts: 29
Joined: Tue May 04, 2010 4:47 am

How to UTC graphs ?

Post by choefing »

Hey there,

might be a stupid question but please, how can I manage to show the times in graphs in UTC rather than local time ?

Cacti 1.2.17 @debian10
php 7.3

Everything on the cacti server is set to UTC:

Code: Select all

# grep timezone /etc/php/7.3/apache2/php.ini
date.timezone = UTC

Code: Select all

# timedatectl 
               Local time: Wed 2021-06-09 11:15:32 UTC
           Universal time: Wed 2021-06-09 11:15:32 UTC
                 RTC time: Wed 2021-06-09 11:15:32
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: inactive
          RTC in local TZ: no

Code: Select all

MariaDB [(none)]> select now();
+---------------------+
| now()               |
+---------------------+
| 2021-06-09 11:17:19 |
+---------------------+
1 row in set (0.000 sec)
Even cacti.log in browser shows UTC.

Within Cactis "Technical support":

Code: Select all

Technical Support [Summary]
Date	Wed, 09 Jun 2021 13:15:58 +0200
but phpinfo within ^^ clearly also states UTC

Code: Select all

date
date/time support 	enabled
timelib version 	2018.04
"Olson" Timezone Database Version 	0.system
Timezone Database 	internal
Default timezone 	Etc/GMT-2
date.default_latitude	31.7667	31.7667
date.default_longitude	35.2333	35.2333
date.sunrise_zenith	90.583333	90.583333
date.sunset_zenith	90.583333	90.583333
date.timezone	Etc/GMT-2	UTC
The operating systems we are connecting from to the cacti server are localtime (GMT+2) Windows 10 which can not be set to UTC.
Tested UTC of course and immediately Cacti graphs showed the times we need.
So Cacti/Browser interprets clients timezone to show time according to it. We need to avoid that as we only report in UTC.

I was not able to figure out any setting to work around this issue. Any thoughts ?

Thanks
CH
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: How to UTC graphs ?

Post by netniV »

Have you made sure you checked ALL your php.ini's ? There are multiple on ubuntu.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
choefing
Posts: 29
Joined: Tue May 04, 2010 4:47 am

Re: How to UTC graphs ?

Post by choefing »

Yes, I did.

Code: Select all

#  find / -name php.ini -exec ls  {} \;
/etc/php/7.0/apache2/php.ini
/etc/php/7.0/cli/php.ini
/etc/php/7.3/apache2/php.ini
/etc/php/7.3/cli/php.ini

Code: Select all

#  find / -name php.ini -exec grep date.timezone  {} \;
; http://php.net/date.timezone
date.timezone = UTC
; http://php.net/date.timezone
date.timezone = UTC
; http://php.net/date.timezone
date.timezone = UTC
; http://php.net/date.timezone
date.timezone = UTC
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: How to UTC graphs ?

Post by netniV »

And you have restarted apache/php-fpm since you did that?

I do love it when I see people using find, coz it's so underused a lot of people I know. :)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
choefing
Posts: 29
Joined: Tue May 04, 2010 4:47 am

Re: How to UTC graphs ?

Post by choefing »

AFAIK I set up the system months ago and it was UTC from the very beginning. Unfortunately I can't tell since when or which 1.x version it shows local time instead of UTC or if it ever did. Nobody complained until few days ago.

Where there changes from 1.2.15/16 to 1.2.17 which might be related to some behaviour like this ?
apache service has been restarted yes. e

With 1.2.16 we switched to spine with systemd, this is, except the stable version upgrades from time to time, the only change I am aware of.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: How to UTC graphs ?

Post by netniV »

Well, the other change is summer time :)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
choefing
Posts: 29
Joined: Tue May 04, 2010 4:47 am

Re: How to UTC graphs ?

Post by choefing »

Which is 1 or 2 hours OFF UTC for us, so also not a proper way to move whole NOCs do appropriate timezones :D

Anyway, despite having all the system running UTC, is there something I am missing for the graphs to show UTC or is it just expected behaviour to reflect clients TZ and I need to raise a feature request in github to have an option to set graphs to certain timezone / UTC ?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests