0

I have two instances of zabbix running on two different RHEL servers. Data presented in web user interface on one are off by 2 hours and on the other by 3 hours (ahead). For example instead of 15:00 it says 17:00. Timezone in /etc/php.ini is set properly to America/Vancouver (the same as settings on my desktop). I use MySQL and database settings are ok as well. calling 'select now() from dual' test returns correct time.

Tomas
  • 490
  • 6
  • 14

3 Answers3

1

Edit file: vim /etc/apache2/conf-available/zabbix.conf

Update line : php_value date.timezone America/Sao_Paulo

Edit file: vim /etc/php5/apache2/php.ini

Update line: [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = America/Sao_Paulo

Now restart apache. /etc/init.d/apache2 restart

0

What does typing

date

return? Do you have your systems ZONE parameter correctly configured?

My Zabbix installations have both /etc/php.ini and the system's ZONE consistent.

vi /etc/sysconfig/clock

and garantee it's set to:
ZONE="America/Vancouver"

For the host time to reflect the change timezone link the intended zoneinfo file to /etc/localtime,

ln -sf /usr/share/zoneinfo/America/Vancouver /etc/localtime
Joao Figueiredo
  • 3,120
  • 3
  • 31
  • 40
  • 'date' returns correct time (Tue Mar 15 10:15:45 PDT 2011) /etc/sysconfig/clock is properly set to ZONE="America/Vancouver" and I created the link as you suggested. Restarted both server and agent. Still showing time two hours ahead (15.03.2011 07:35 - 15.03.2011 12:15 (now!)). Do I need to restart any other service? – Tomas Mar 15 '11 at 17:20
0

All problems with time in Zabbix are caused by a problem with the client browser, the Zabbix server (Web or Server process) or a combination of the two. The time of the Database server however does not matter.

Check to see what the host thinks the timezone is.

This link: How do I find the current system timezone? has more detailed information on how to determine the timezone, but the gist on your RHEL box will be:

ls -l /etc/localtime

If that is a symlink, job done you can now see your timezone.

if not then use the following to determine the timezone.

685e6cae6f7d63e690bf35b955ff4afb  /etc/localtime
[root@admin ~]# find /usr/share/zoneinfo -type f | xargs md5sum | grep 685e6cae6f7d63e690bf35b955ff4afb
685e6cae6f7d63e690bf35b955ff4afb  /usr/share/zoneinfo/posix/America/Los_Angeles
685e6cae6f7d63e690bf35b955ff4afb  /usr/share/zoneinfo/posix/US/Pacific
685e6cae6f7d63e690bf35b955ff4afb  /usr/share/zoneinfo/America/Los_Angeles
685e6cae6f7d63e690bf35b955ff4afb  /usr/share/zoneinfo/US/Pacific

PHP (The web frontend) then put's own timezone information on top of everything else.

Community
  • 1
  • 1
Red Tux
  • 111
  • 3