Ad Widget

Collapse

graphs displaying wrong date/time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jpreed00
    Junior Member
    • Jan 2011
    • 3

    #1

    graphs displaying wrong date/time

    The system clock is correct. Yet zabbix is displaying data on the graphs from about 7 hours in the future. If it truly was how my servers were going to be operating 7 hours in the future, that would be awesome. However, I fear the date is simply being improperly displayed.

    Any ideas about what would cause this and how I might go about fixing it?

    Thanks!
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    A few things... What is the hardware clock set to on your server (local or UTC), then what is the timezone for your server? Also what is the timezone in your php.ini file.

    It is important that your local timezone be set correctly and display the time correctly on the commandline, and that the php.ini file match. Php however does not adjust the time as it uses it from the system clock.

    Lastly what is the time and timezone on the client you are using to view the graphs?
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • jpreed00
      Junior Member
      • Jan 2011
      • 3

      #3
      Zabbix Host:

      linux-epfq:~ # hwclock --show
      Sun Jan 23 15:19:55 2011 -0.285126 seconds
      linux-epfq:~ # date
      Mon Jan 24 15:20:16 EST 2011
      linux-epfq:~ # date -u
      Mon Jan 24 20:20:28 UTC 2011


      The client is also set correctly.

      PHP time zone was set for Europe/Riga. There are, apparently, several php.ini files floating around the Zabbix appliance. I had already changed one of them--but it was the wrong one. That fixed one of the issues. The time is now displaying correctly.

      Now the graphs are displaying 1 full day ahead. See attached screenshot.

      Edit: Just saw that the date is showing one full day ahead of the hwclock. Missed that before. Any idea why that might be?
      Attached Files
      Last edited by jpreed00; 23-01-2011, 22:51.

      Comment

      • jpreed00
        Junior Member
        • Jan 2011
        • 3

        #4
        Alrighty, got it figured out now.

        There was some tutorial on the net that had you resetting the system clock from the hardware clock using:

        hwclock --systohc

        That command actually copies the system time to the hardware clock. (As the name implies...)

        The actual command you want once setting the hardware clock and timezone correctly is:

        hwclock --hctosys

        For those looking how to set the proper time for their Zabbix installation, these are the steps you have to follow:

        1. Set your php.ini (for the zabbix appliance, the path is /etc/php5/apache2/php.ini)
        Find the line: date.timezone = <some timezone> and change it appropriately.

        2. Change the system timezone.
        Follow this tutorial: http://www.wikihow.com/Change-the-Timezone-in-Linux

        3. If necessary, update the hardware clock, then reflect the changes back to the system clock.
        hwclock --set --date="MM/DD/YYYY HH:MM" --localtime
        hwclock --hctosys
        Last edited by jpreed00; 23-01-2011, 23:02.

        Comment

        • hexk
          Junior Member
          • Dec 2016
          • 1

          #5
          Originally posted by jpreed00
          Alrighty, got it figured out now.
          ...
          For those looking how to set the proper time for their Zabbix installation, these are the steps you have to follow:
          ...
          Thank you. You reply gave me pointers where to look.
          What solved my timezone problem with Version 3.2 was setting php_value date.timezone America/Toronto in /etc/apache2/conf-available/zabbix.conf file

          Comment

          • ashfaq
            Junior Member
            • Mar 2017
            • 1

            #6
            Originally posted by hexk
            Thank you. You reply gave me pointers where to look.
            What solved my timezone problem with Version 3.2 was setting php_value date.timezone America/Toronto in /etc/apache2/conf-available/zabbix.conf file
            For v3.2 also please make sure that /etc/apace2/conf-enabled/zabbix.conf file should be amended as well.

            In <IfModule mod_php5.c> block, find entry php_value date.timezone Europe/Riga and change it according to your Timezone.

            In <IfModule mod_php7.c> block, find entry php_value date.timezone Europe/Riga and change it according to your Timezone.

            Ash

            Comment

            • phaelf
              Junior Member
              • Sep 2020
              • 1

              #7
              for version 5.0 change in

              # grep timezone /etc/php-fpm.d/zabbix.conf
              php_value[date.timezone] = Europe/Riga

              Comment

              • G0osS
                Junior Member
                • Mar 2024
                • 2

                #8
                I've had the same problem...
                Last edited by G0osS; 05-10-2024, 12:53.

                Comment

                Working...