Cacti-Graph Presentation Time
Moderators: Developers, Moderators
Cacti-Graph Presentation Time
Hello All,
I see my cacti Graph time showing an Hour ahead of my system, php.ini and mysql-time.
the two php.ini files are set this way:
/etc/php7/cli/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Berlin"
/etc/php7/apache2/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Berlin"
shell>timedatectl
shows correct time
Time zone: Europe/Berlin (CET, +0100)
sudo mysql -e "SELECT @@global.time_zone;"
[sudo] password for user:
+--------------------+
| @@global.time_zone |
+--------------------+
| SYSTEM |
+--------------------+
which ich also correct
sudo mysql -e "SELECT NOW();"
+---------------------+
| NOW() |
+---------------------+
| 2020-11-08 09:40:05 | CORRECT
+---------------------+
The only wrong time I see in my system is when I use the following command:
php -r "echo date ('Ymd His');"
20201108 104022shell~>
I tied to set default time in my.cnf file. Unfortunately, the issue remains still.
Now, my Question is where does cacti take this time presentation from?
I have read that I could set correct time in php script, by doing:
date_default_timezone_set('Europe/Berlin');
But my problem is, that I have no idea about which php script is responsible for that.
Any Idea which can be helpfull is very much appriciated.
Thanx and best Regards
I see my cacti Graph time showing an Hour ahead of my system, php.ini and mysql-time.
the two php.ini files are set this way:
/etc/php7/cli/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Berlin"
/etc/php7/apache2/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Berlin"
shell>timedatectl
shows correct time
Time zone: Europe/Berlin (CET, +0100)
sudo mysql -e "SELECT @@global.time_zone;"
[sudo] password for user:
+--------------------+
| @@global.time_zone |
+--------------------+
| SYSTEM |
+--------------------+
which ich also correct
sudo mysql -e "SELECT NOW();"
+---------------------+
| NOW() |
+---------------------+
| 2020-11-08 09:40:05 | CORRECT
+---------------------+
The only wrong time I see in my system is when I use the following command:
php -r "echo date ('Ymd His');"
20201108 104022shell~>
I tied to set default time in my.cnf file. Unfortunately, the issue remains still.
Now, my Question is where does cacti take this time presentation from?
I have read that I could set correct time in php script, by doing:
date_default_timezone_set('Europe/Berlin');
But my problem is, that I have no idea about which php script is responsible for that.
Any Idea which can be helpfull is very much appriciated.
Thanx and best Regards
Re: Cacti-Graph Presentation Time
What is your system timezone set to?
Code: Select all
timedatectl
Re: Cacti-Graph Presentation Time
Thank You cigamit for supporting:-)
Like you can see it in preveous Thread my system time zone set is: Europe/Berlin
shell> timedatectl
Local time: Mon 2020-11-09 19:12:55 CET
Universal time: Mon 2020-11-09 18:12:55 UTC
RTC time: Mon 2020-11-09 22:12:54
Time zone: Europe/Berlin (CET, +0100)[/i]
Network time on: no
NTP synchronized: no
RTC in local TZ: no
This is actually correct with my system, but not with cacti.
As far as I Know I can only set it like this:
shell> sudo timedatectl set-timezone "Europe/Berlin"
shell> timedatectl
Local time: Mon 2020-11-09 19:30:11 CET
Universal time: Mon 2020-11-09 18:30:11 UTC
RTC time: Mon 2020-11-09 22:30:10
Time zone: Europe/Berlin (CET, +0100)
Network time on: no
NTP synchronized: no
RTC in local TZ: no
I also tried to change it to UTC time which is an Hour behind us, to see if cacti can talk to my UTC time NO WAY I can set whatever I want to, cacti doesn't care about timedatectl set.
As Isaid before, the only wrong time I see in my system, I mean appart from cacti is:
shell> php -r "echo date ('Ymd His');"
20201109 205305shell>
cacti follows this php time and which php file do this.
Regards
Like you can see it in preveous Thread my system time zone set is: Europe/Berlin
shell> timedatectl
Local time: Mon 2020-11-09 19:12:55 CET
Universal time: Mon 2020-11-09 18:12:55 UTC
RTC time: Mon 2020-11-09 22:12:54
Time zone: Europe/Berlin (CET, +0100)[/i]
Network time on: no
NTP synchronized: no
RTC in local TZ: no
This is actually correct with my system, but not with cacti.
As far as I Know I can only set it like this:
shell> sudo timedatectl set-timezone "Europe/Berlin"
shell> timedatectl
Local time: Mon 2020-11-09 19:30:11 CET
Universal time: Mon 2020-11-09 18:30:11 UTC
RTC time: Mon 2020-11-09 22:30:10
Time zone: Europe/Berlin (CET, +0100)
Network time on: no
NTP synchronized: no
RTC in local TZ: no
I also tried to change it to UTC time which is an Hour behind us, to see if cacti can talk to my UTC time NO WAY I can set whatever I want to, cacti doesn't care about timedatectl set.
As Isaid before, the only wrong time I see in my system, I mean appart from cacti is:
shell> php -r "echo date ('Ymd His');"
20201109 205305shell>
cacti follows this php time and which php file do this.
Regards
Re: Cacti-Graph Presentation Time
try run this script:
<?php
echo date_default_timezone_get();
?>
What is returned? Europe/Berlin? Something else? Nothing?
Try to run
shell: php --ini
and check all ini files
<?php
echo date_default_timezone_get();
?>
What is returned? Europe/Berlin? Something else? Nothing?
Try to run
shell: php --ini
and check all ini files
Let the Cacti grow!
Re: Cacti-Graph Presentation Time
Ha macan,
I checked every ini File:
shell> php --ini
Configuration File (php.ini) Path: /etc/php7/cli
Loaded Configuration File: /etc/php7/cli/php.ini
this one is setup to Europe/Berlin
and the other ini Files are
Scan for additional .ini files in: /etc/php7/conf.d
Additional .ini files parsed: /etc/php7/conf.d/ctype.ini,
/etc/php7/conf.d/curl.ini, etc. there are a lot of them, but they all consist two lines defining the extension name.
For example: curl.ini
;comment out next line to disable curl extension in php
extension=curl.so
Very Starnge isn't it?
cacti is still with the wrong time an Hour ahead.
Thank You and Best Regards
I checked every ini File:
shell> php --ini
Configuration File (php.ini) Path: /etc/php7/cli
Loaded Configuration File: /etc/php7/cli/php.ini
this one is setup to Europe/Berlin
and the other ini Files are
Scan for additional .ini files in: /etc/php7/conf.d
Additional .ini files parsed: /etc/php7/conf.d/ctype.ini,
/etc/php7/conf.d/curl.ini, etc. there are a lot of them, but they all consist two lines defining the extension name.
For example: curl.ini
;comment out next line to disable curl extension in php
extension=curl.so
I did the Result was Europe/Berlin.try run this script:
<?php
echo date_default_timezone_get();
?>
Very Starnge isn't it?
cacti is still with the wrong time an Hour ahead.
Thank You and Best Regards
Re: Cacti-Graph Presentation Time
do this in PHP
Code: Select all
<?php
print date('c e I');
Re: Cacti-Graph Presentation Time
Hi
2020-11-10T00:15:10+02:00 Europe/Berlin 1
Here is the Result:do this in PHP
CODE: SELECT ALL
<?php
print date('c e I');
2020-11-10T00:15:10+02:00 Europe/Berlin 1
Re: Cacti-Graph Presentation Time
So the timezone is correct. The 1 at the end is telling us that you are currently in Daylight Savings Time, so its moving it forward an hour. The system time seems to be ignoring daylight savings?
Re: Cacti-Graph Presentation Time
Hi,
yes I was also wondering to see one day foreward but what can I do to correct this?
Any Idea to force to sustruct one Hour instead?
Thank You for taking time I appriciate that:-)
Cheers
yes I was also wondering to see one day foreward but what can I do to correct this?
Any Idea to force to sustruct one Hour instead?
Thank You for taking time I appriciate that:-)
Cheers
Re: Cacti-Graph Presentation Time
try phpinfo()
It seems that PHP is using another timezone/daylight saving definition than your system. Check this
https://stackoverflow.com/questions/520 ... plesk-onyx
It seems that PHP is using another timezone/daylight saving definition than your system. Check this
https://stackoverflow.com/questions/520 ... plesk-onyx
- Attachments
-
- Screenshot_2020-11-10 PHP 7 4 8 - phpinfo().png (32.45 KiB) Viewed 1382 times
Let the Cacti grow!
Re: Cacti-Graph Presentation Time
Hello macan, cigamit
GREAT JOB, Perfect!!! that was exactly what was needed. I did the timezonedb installation as suggested and enter the extension under php.ini and rebooted system.
Every Thing is fine cacti has the same time with my system.
I am very GREATFULL for your HELP:-) I stand up, take my Hat off and BOW Down with Respect. Wonderful.
Fro those of you maybe with Open SUSE or SUSE Linux at all, this is the way you should do it, you can not just come and say pecl install timedb. Your system does not know pecl yet.
DO:
sudo zypper in gcc autoconf php7 php7-pear php7-devel
check if it shows you
shell>pecl version
Now, you are ready to install the timezonedb:
sudo pecl install timezonedb
At the End add the extension definition in all php.ini files.
extension=timezonedb.so
clean up your system:
shell> pear clear-cache
shell> pear update-channels
shell> pear upgrade
REBOOT
and check the new time:
shell>php -r "echo 'Current time: ' . date('Y-m-d H:i:s');"
DONE.
Thank YOU very much:-)
GREAT JOB, Perfect!!! that was exactly what was needed. I did the timezonedb installation as suggested and enter the extension under php.ini and rebooted system.
Every Thing is fine cacti has the same time with my system.
I am very GREATFULL for your HELP:-) I stand up, take my Hat off and BOW Down with Respect. Wonderful.
Fro those of you maybe with Open SUSE or SUSE Linux at all, this is the way you should do it, you can not just come and say pecl install timedb. Your system does not know pecl yet.
DO:
sudo zypper in gcc autoconf php7 php7-pear php7-devel
check if it shows you
shell>pecl version
Now, you are ready to install the timezonedb:
sudo pecl install timezonedb
At the End add the extension definition in all php.ini files.
extension=timezonedb.so
clean up your system:
shell> pear clear-cache
shell> pear update-channels
shell> pear upgrade
REBOOT
and check the new time:
shell>php -r "echo 'Current time: ' . date('Y-m-d H:i:s');"
DONE.
Thank YOU very much:-)
Re: Cacti-Graph Presentation Time
Achea9 wrote: ↑Wed Nov 11, 2020 5:31 am Hello macan, cigamit
GREAT JOB, Perfect!!! that was exactly what was needed. I did the timezonedb installation as suggested and enter the extension under php.ini and rebooted system.
Every Thing is fine cacti has the same time with my system.
I am very GREATFULL for your HELP:-) I stand up, take my Hat off and BOW Down with Respect. Wonderful.
Fro those of you maybe with Open SUSE or SUSE Linux at all, this is the way you should do it, you can not just come and say pecl install timedb. Your system does not know pecl yet.
DO:
sudo zypper in gcc autoconf php7 php7-pear php7-devel
check if it shows you
shell>pecl version
Now, you are ready to install the timezonedb:
sudo pecl install timezonedb
At the End add the extension definition in all php.ini files.
extension=timezonedb.so
UPS I expected the opposite situation that you have pecl and it will be necessary to remove it
The main thing is that it works.
clean up your system:
shell> pear clear-cache
shell> pear update-channels
shell> pear upgrade
REBOOT
and check the new time:
shell>php -r "echo 'Current time: ' . date('Y-m-d H:i:s');"
DONE.
Thank YOU very much:-)
Let the Cacti grow!
Who is online
Users browsing this forum: No registered users and 2 guests