Ad Widget

Collapse

Zabbix is recording Wrong time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • espnet
    Junior Member
    • May 2005
    • 7

    #1

    Zabbix is recording Wrong time

    it seems to Zabbix Server is sending the data to mysql using UTC time instead of localtime. I am trying to figure out how to make Zabbex_Server use the localtime instead.

    If I adjust the UTC time to correct the issue then I get wrong time for alerts.

    so it seems that for Alerts zabbix uses localtime and for data it uses UTC time.

    Is there a way around this. I tried setting the localtime zone to UTC, but I still get wrong time from my mail client since it looks at the time zone and adjusts it for EST.

    Is anyone else having this issue??

    The hwclock is set to localtime too.

    Thanks!
  • espnet
    Junior Member
    • May 2005
    • 7

    #2
    I oh yeah, I am running zabbix1.1beta 9 on slackware 10.1.

    the mysql is running on another server too.

    Comment

    • espnet
      Junior Member
      • May 2005
      • 7

      #3
      I cant be the only one having this issue.


      I did compile zabbix staticly. That might be the problem, since I never see zabbix_server grab /etc/localetime or anyother time source from startup or while it is running.

      I will try to compile without staic to see if that resolves the UTC time issue.

      Comment

      • espnet
        Junior Member
        • May 2005
        • 7

        #4
        ^^bump!!^^

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          ZABBIX uses stdlib's function time() for all timestamps. I'm pretty sure it returns localtime otherwise it would be reported million of times.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • espnet
            Junior Member
            • May 2005
            • 7

            #6
            Thanks for the reply.

            I s there a way to force stdlib to use localtime instead of UTC time?

            It seems when I adjust the utc time with date -u -s to show what the correct ESt time would be. Zabbix inputs all data with correct times, but then email alerts are off by 4hrs. Can anyone think of away to fix this or tell my where to look for a configuration error?

            Thanks!

            Comment

            • espnet
              Junior Member
              • May 2005
              • 7

              #7
              So how would I debug this in order to fix the time issue??

              Comment

              • gedp
                Member
                • May 2006
                • 47

                #8
                To get the local time, you should use something like:

                time(&clock);
                tp=localtime(&clock);

                I do however not know if this is related to the problem.

                Comment

                • fmtaylor2
                  Member
                  • May 2006
                  • 66

                  #9
                  timeconfig

                  It sounds like when you did your slackware setup you told it the your clock was set to UTC not localtime. re-run your time configuration script (the name of which escapes me at the moment) and correct this configuration issue.

                  Comment

                  • espnet
                    Junior Member
                    • May 2005
                    • 7

                    #10
                    The local time is showing the correct time. I think it has todo with mysql now. I was running strace on the msqld process and it was showing time(NULL) from the zabbix server. On my test setup I ran strace on the mysql server that was reporting correctly in the webgui and it showed time(871628). I think there is an issue with mysql seeing the time as NULL and stamping it as UTC.

                    The only difference in my lab vs production is my lab mysql server is 4.1.14 and production is 4.1.18.

                    Looking more into this now.

                    Comment

                    • diopter
                      Junior Member
                      • May 2006
                      • 26

                      #11
                      i have time problem too..
                      my graph r showing wrong time figure ..

                      the graph time is 1 hour early than my local time..
                      why is it such thing happen?

                      Comment

                      • zabbix-emaxx
                        Junior Member
                        • Jun 2006
                        • 13

                        #12
                        Originally posted by espnet
                        The local time is showing the correct time. I think it has todo with mysql now. I was running strace on the msqld process and it was showing time(NULL) from the zabbix server. On my test setup I ran strace on the mysql server that was reporting correctly in the webgui and it showed time(871628). I think there is an issue with mysql seeing the time as NULL and stamping it as UTC.

                        The only difference in my lab vs production is my lab mysql server is 4.1.14 and production is 4.1.18.

                        Looking more into this now.
                        I running in to this problem too .. I guess.. Zabbix is recording an hour earlier than my localtime (GMT +1).


                        Did anyone sovle this one?

                        Comment

                        • zabbix-emaxx
                          Junior Member
                          • Jun 2006
                          • 13

                          #13
                          Nevermind, zabbix stopt monitoring at all ... for some reason ...

                          Comment

                          Working...