Ad Widget

Collapse

Event and graph time is wrong

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Karl_MCS
    Junior Member
    • Dec 2015
    • 8

    #1

    Event and graph time is wrong

    Good morning,

    I've installed Zabbix a number of times in the past on Ubuntu, but on an installation I did last week, I decided to try using the appliance thinking it would save me some time. It turned out to have the opposite effect because I had to change so much in the appliance system. Case in point...

    The Zabbix frontend is displaying time 8 hours ahead. This is interesting because my timezone is America/Chicago which is UTC-6. I've done everything I can come up with to set the system to the correct timezone, but something is still wrong. If I type date at the console, the system time and zone are correct. This is what I have changed:

    I have run dpkg-reconfigure tzdata and set the timezone to America/Chicago which sets the correct /etc/localtime and /etc/timezone.

    I have changed both date.timezone lines in /etc/zabbix/apache2.conf

    I have changed date.timezone in /etc/php5/apache2/php.ini

    I have installed and configured ntpd and confirmed it is updating.

    I have restarted the server many times.

    I don't know what else to do. I've lost a lot more time troubleshooting this than I would have by manually installing both Ubuntu and Zabbix. The system time is correct everywhere except the Zabbix frontend. I remember having this problem on Ubuntu and being able to fix it by doing the above, but I don't know what's configured differently in this appliance.

    Any advice is greatly appreciated...
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #2
    I never installed Zabbix appliance, but... what about /etc/httpd/conf.d/zabbix.conf ?
    Or just search for file with text "date.timezone Europe/Riga"

    Comment


    • JD91
      JD91 commented
      Editing a comment
      That's correct for red hat!
      I only read your post after I found the solution.. ^^'
  • Karl_MCS
    Junior Member
    • Dec 2015
    • 8

    #3
    /etc/httpd/conf.d/zabbix.conf doesn't exist on the system. I think that's the path for redhat. The appliance looks like it's based on Ubuntu 14.04 and this file is in /etc/zabbix/apache2.conf.

    I did grep /etc/zabbix, /etc/apache2, and /etc/php5 files for the word 'zone' and didn't come up with anything else.

    Comment

    • Semiadmin
      Senior Member
      • Oct 2014
      • 1625

      #4
      RTFM...



      1.5 Changing time zone

      By default the appliance uses UTC for the system clock. To change the time zone, copy the appropriate file from /usr/share/zoneinfo to /etc/localtime, for example:

      cp /usr/share/zoneinfo/Europe/Riga /etc/localtime

      Comment

      • Karl_MCS
        Junior Member
        • Dec 2015
        • 8

        #5
        Maybe you should read my post before telling me to RTFM. I already did this when I ran dpkg-reconfigure tzdata.

        Honestly...

        Comment

        • Karl_MCS
          Junior Member
          • Dec 2015
          • 8

          #6
          md5sum /etc/localtime /usr/share/zoneinfo/America/Chicago
          d0f076c9f390e7d8a933cc7cc1ad2e90 /etc/localtime
          d0f076c9f390e7d8a933cc7cc1ad2e90 /usr/share/zoneinfo/America/Chicago

          Comment

          • Semiadmin
            Senior Member
            • Oct 2014
            • 1625

            #7
            Sorry, Karl_MCS, I havn't Zabbix appliance. All I have got - this manual...

            Comment

            • Karl_MCS
              Junior Member
              • Dec 2015
              • 8

              #8
              I finally fixed it. For anyone else who runs into this, there is YET ANOTHER pair of PHP date.timezone entries in /etc/apache2/conf-available/zabbix.conf. This file appears to actually control the frontend.

              I guess /etc/zabbix/apache.conf does nothing? They appear to have the same contents.

              Comment


              • mauriciopeclatlopes
                mauriciopeclatlopes commented
                Editing a comment
                Thanks a lot for sharing the solution Karl_MCS!
            • ybizeul
              Junior Member
              • Mar 2018
              • 20

              #9
              yes that thing is a joke.

              I managed to change web UI time by following the doc down on the appliance page, but for the life of me can’t figure out why the events are shifted 16 hours. I’m in GMT+1, it doesn’t make any sense.

              And the doc, well, mostly useless, the thing tells you there is no MySQL password for example which is wrong.

              Comment

              • ottolo
                Junior Member
                • Jan 2019
                • 1

                #10
                Hello everyone,

                for nginx in my case ( centos)​​​​​​​
                sudo vi /etc/nginx/conf.d/default.conf

                date.timezone = America/Chicago
                don't forget to restart nginx
                sudo systemctl restart nginx

                Thank you

                Comment

                • wolflikes
                  Junior Member
                  • Oct 2007
                  • 8

                  #11
                  I am having exactly the same problem. I am not seeing a zabbix.conf file though, only a zabbix.conf.php. I am on version 4.0.9. Could you please post the two relevant lines. I want to see if they will work in the zzabbix.conf.php file.

                  Comment

                  • WalongE
                    Junior Member
                    • Aug 2019
                    • 1

                    #12
                    thank you!!!
                    i have same problem
                    because of your advise ( change => /etc/apache2/conf-available/zabbix.conf)
                    finally i changed timezone = Asia/Seoul
                    고맙습니다 덕분에 한국시간으로 바꿨네요 감사해요~

                    Comment

                    • arthur_veber
                      Junior Member
                      • Sep 2020
                      • 1

                      #13
                      I think i found it. In my case this problem was because of wrong time on HyperV server. It had wrong timezone and time on windows server.

                      Comment

                      • JD91
                        Junior Member
                        • Oct 2020
                        • 1

                        #14
                        Hello,

                        I just had the same problem, but I´m using the httpd.service.

                        Solution:

                        file:
                        /etc/httpd/conf.d/zabbix.conf

                        line:
                        php_value date.timezone Europe/"yourCity"

                        Thank you!

                        Comment

                        Working...