Correcting Cacti Timezone
Battled a super annoying issue with what appeared to be Cacti not displaying graphs, which after half a day of messing around ended up being a timezone setting…..grrrrrrrrrrrr
After discovering Cacti was indeed graphing my expected values, just 4 hours ahead of my local time (EDT, America/Toronto) I realized cacti.log was showing UTC timestamps.
After confirming my Linux system time:
pi@raspberrypi ~ $ date
Fri Aug 17 04:39:13 EDT 2012
I dug around on cacti.net and found instructions on updating php.ini with timezone values:
I had seen this warning while checking the apache2 error log earlier and corrected the php.ini file accordingly:
sudo vi /etc/php5/apache2/php.ini
date.timezone = America/Toronto
The list of supported php timezones can be found here
No luck. Cacti’s log still tracked in UTC and graph timezones were still off. I read about mysql and rrdtool timezone altering etc…but both tools were fine, showing the correct system time.
finally i decided to search for any other php.ini file that might exist on my system:
sudo find / -name php.ini
what do you know…..
updated the alternate php.ini file accordingly, restarted apache….and we’re live!
wow…i need a beer.