It took me a while to notice what was happening. I live in Italy. (CET or Central European Time). The timezone info on my fresh install of openSuSE 12.1 is set as such, and the hardware clock is set to UTC. I'm using ntp on the box and it stays pretty accurate. My graphs for cacti however don't seem to realize all of that.
Every graph shows up two hours late with the last two hours of the graph blank. For example the graph data would go up to 1800 when it is actually 2000. Even for the localhost data. This just happens to be the time difference from UTC to CET right now with day light savings in effect. It took me a while to notice because the data doesn't show up for two hours.
I'm sure it has something to do with a timezone setting somewhere, but I can find no reference to timezone settings in cacti. I've set the timezone to CET in the php.ini, but that doesn't seem to have made any effect.
ideas?
Local time vs UTC
Moderators: Developers, Moderators
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Local time vs UTC
Current Cacti does not have a timezone setting on it's own. It relies on the system and php timezone
R.
R.
Re: Local time vs UTC
So what do you recommend?
Re: Local time vs UTC
Here's an example.
Note the time frame of the graph. This image was saved at 8:44. But the data at 6:40 is the current data.
I took a look at the cacti.log and realized the poller is logging to it two hours late. (ie the same time as what is showing up on the graphs.) I'm relatively certain it is something with php , but can't think what. I've tried a few different timezone settings in php.ini. The only thing that really makes a changes is if I set it to UTC. Then the graphs look normal, just two hours behind. Well, on time just for UTC not my timezone. FWIW, I'm not a php guru, perl is my forte, so I haven't even tried to analyze any of the php code.
Note the time frame of the graph. This image was saved at 8:44. But the data at 6:40 is the current data.
I took a look at the cacti.log and realized the poller is logging to it two hours late. (ie the same time as what is showing up on the graphs.) I'm relatively certain it is something with php , but can't think what. I've tried a few different timezone settings in php.ini. The only thing that really makes a changes is if I set it to UTC. Then the graphs look normal, just two hours behind. Well, on time just for UTC not my timezone. FWIW, I'm not a php guru, perl is my forte, so I haven't even tried to analyze any of the php code.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Local time vs UTC
Did you restart httpd, then?immauss wrote: I've set the timezone to CET in the php.ini, but that doesn't seem to have made any effect.
R.
Re: Local time vs UTC
So in a "grasping at straws" effort, I went through the other files in the /etc/php directory looking for another one with a timezone setting. Sure enough , /etc/php5/cli/php.ini had a timezone setting and it was set to "UTC". I changed it to my local timezone, and poof! Now all of my graphs are looking as they should.
Re: Local time vs UTC
i feel your pain!
Spent a day troubleshooting this! Has only ever happened to me once out of 10+ cacti installs.
Wrote a tutorial on it here:
http://n00blab.com/correcting-cacti-timezone/
Gandalf, just have future users complaining of this to run:
sudo find / -name php.ini
they will like have:
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
as immauss and I did!
Spent a day troubleshooting this! Has only ever happened to me once out of 10+ cacti installs.
Wrote a tutorial on it here:
http://n00blab.com/correcting-cacti-timezone/
Gandalf, just have future users complaining of this to run:
sudo find / -name php.ini
they will like have:
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
as immauss and I did!
Re: Local time vs UTC
It made sense after I thought about it a bit. cmd.php is using the php.ini in /etc/php5/cli (it is running from the CLI) and the web pages are all using the one from the /etc/php5/apache2 directory.
But I couldn't find any reference to it on the web anywhere either. Hopefully this thread and your tut will make up for that.
Thanks,
But I couldn't find any reference to it on the web anywhere either. Hopefully this thread and your tut will make up for that.
Thanks,
Who is online
Users browsing this forum: No registered users and 3 guests