graphs 2 hours behind system time
Moderators: Developers, Moderators
-
- Posts: 19
- Joined: Tue Jan 25, 2005 2:17 pm
graphs 2 hours behind system time
Heya All,
I recently installed cacti on a new server (CentOS) and imported all my old cacti server's data etc. That seemed to go quite well and everything was hunky-dory.
I then realized that my new server had both the time and timezone set wrong. It was set to Central Time and was also 1 hour wrong (behind) at that. So I fixed that by changing the symlink for the time zone (I am EST) and then used webmin to adjust the hardware/system time to be correct. Now all my graphs are 2 hours behind, meaning that if I look at my graphs at 1 PM the graphs only show up until 11am. I have rebooted to no avail. When I use the CLI 'clock' command it shows the correct time/date/zone but cacti seems to think it is 2 hours earlier (still on the old settings it seems).
Any thoughts or help would be greatly appreciated!
Regards,
Chumley
I recently installed cacti on a new server (CentOS) and imported all my old cacti server's data etc. That seemed to go quite well and everything was hunky-dory.
I then realized that my new server had both the time and timezone set wrong. It was set to Central Time and was also 1 hour wrong (behind) at that. So I fixed that by changing the symlink for the time zone (I am EST) and then used webmin to adjust the hardware/system time to be correct. Now all my graphs are 2 hours behind, meaning that if I look at my graphs at 1 PM the graphs only show up until 11am. I have rebooted to no avail. When I use the CLI 'clock' command it shows the correct time/date/zone but cacti seems to think it is 2 hours earlier (still on the old settings it seems).
Any thoughts or help would be greatly appreciated!
Regards,
Chumley
Re: graphs 2 hours behind system time
--
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Re: graphs 2 hours behind system time
I changed the php.ini timezone. The graph is updated but the cacti logs is still the same.
Re: graphs 2 hours behind system time
And you restarted apache after reseting php.ini?
--
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Re: graphs 2 hours behind system time
Yes I already started the Apache and even restarted the PC.
-
- Posts: 19
- Joined: Tue Jan 25, 2005 2:17 pm
Re: graphs 2 hours behind system time
Heya Linegod and Dranrev,
Linegod: Thanks for putting me on the path to salvation
I fixed the issue on my CactiEZ 0.6 box like so:
Using the fix Linegod suggested seemed to have issues when I researched it FOR THE CACTIEZ VERSION OF PHP (5.1.6). You may have a newer version if you are running a different install of Cacti (i.e. not CactiEZ) and so this 'fix' may not apply. Specifically, setting the timezone manually would cause it to have to be redone when Daylight Savings Time ends for me (I am EST -5 "America/New York" where DST is observed). Since that is just this coming Sunday I didn't want to re-do it. So I installed the 'timezone.db' extension for PHP. This, my research suggested, would automagically adjust for DST etc. I installed it like so:
Prerequisites: CactiEZ is stripped down and so has no c++ compiler and is also missing 'phpize'. I fixed it all with the following:
Fix phpize issue with:
Fix compiler issues with:
Now I was ready to install the timezonedb.so module with:
When that completed I added the module to php by:
Change to the correct dir:
Create the file timezonedb.ini:
Now I edited the timezonedb.ini file with vi so it looks like:
Save and exit vi.
Now make sure your system clock is correct (this step may not be necessary but I did it anyway):
Now restart Apache:
You can also verify that timezonedb is a loaded PHP module with:
You should find timezonedb listed.
Now my graphs are showing they go up to the correct time. It should also automagically adjust for DST.
Hope that helps!
Regards,
Chum
Linegod: Thanks for putting me on the path to salvation
I fixed the issue on my CactiEZ 0.6 box like so:
Using the fix Linegod suggested seemed to have issues when I researched it FOR THE CACTIEZ VERSION OF PHP (5.1.6). You may have a newer version if you are running a different install of Cacti (i.e. not CactiEZ) and so this 'fix' may not apply. Specifically, setting the timezone manually would cause it to have to be redone when Daylight Savings Time ends for me (I am EST -5 "America/New York" where DST is observed). Since that is just this coming Sunday I didn't want to re-do it. So I installed the 'timezone.db' extension for PHP. This, my research suggested, would automagically adjust for DST etc. I installed it like so:
Prerequisites: CactiEZ is stripped down and so has no c++ compiler and is also missing 'phpize'. I fixed it all with the following:
Fix phpize issue with:
Code: Select all
yum install php-devel
Code: Select all
yum install gcc gcc-cpp gcc-c++
Code: Select all
php /usr/share/pear/peclcmd.php install timezonedb
Change to the correct dir:
Code: Select all
cd /etc/php.d
Code: Select all
touch timezonedb.ini
Code: Select all
;enable timezonedb module so
;daylight savings correction is automagic
extension=timezonedb.so
Now make sure your system clock is correct (this step may not be necessary but I did it anyway):
Code: Select all
date -s "D Mo Yr Hr:Min:Sec"
Code: Select all
/ect/init.d/httpd restart
Code: Select all
php -m
Now my graphs are showing they go up to the correct time. It should also automagically adjust for DST.
Hope that helps!
Regards,
Chum
Who is online
Users browsing this forum: No registered users and 2 guests