Ad Widget

Collapse

PATCH: fix OK events

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sauron
    Senior Member
    • Jan 2005
    • 215

    #1

    PATCH: fix OK events

    I'm upgrade zabbix 1.4.7 to zabbix 1.6.1 with migrate from standalone to distributed. After this OK event broken. I'm debug this and found bug. When trigger updated this try update event but sorting wrong (need by clock but sorted by objectid). I'm create patch for fix this.

    UPD: fix some issues in web interface. more fix in web interface.
    Attached Files
    Last edited by sauron; 25-11-2008, 13:41. Reason: Change patch
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    This patch is wrong! There is no need in it.
    Zabbix | ex GUI developer

    Comment

    • sauron
      Senior Member
      • Jan 2005
      • 215

      #3
      Really?! Compare this:

      zabbix=# select eventid,value,to_timestamp(clock),object,objectid from events where source=0 and object=0 and objectid=100100000012888 order by object desc,objectid desc,eventid desc limit 2;
      eventid | value | to_timestamp | object | objectid
      -----------------+-------+------------------------+--------+-----------------
      100100000145899 | 0 | 2008-11-13 13:53:27+05 | 0 | 100100000012888
      100100000145309 | 2 | 2008-11-13 08:44:20+05 | 0 | 100100000012888
      (2 rows)
      This default zabbix query. It's got wrong events.

      select eventid,value,to_timestamp(clock),object,objectid from events where source=0 and object=0 and objectid=100100000012888 order by object desc,clock desc,eventid desc limit 2;
      eventid | value | to_timestamp | object | objectid
      -----------------+-------+------------------------+--------+-----------------
      100100000001624 | 0 | 2008-11-25 15:50:25+05 | 0 | 100100000012888
      100100000001623 | 1 | 2008-11-25 15:49:29+05 | 0 | 100100000012888
      (2 rows)
      This patched zabbix query. This right events.

      Database not shuld sort by time if this not specifed. Our base contain eventid larger than new generated, and need sort by time. You can ignored this.

      PS We used PostgreSQL.

      Comment

      • sauron
        Senior Member
        • Jan 2005
        • 215

        #4
        Hmm. Now i'm think this migration bug. We migrate from 1.4 to 1.6 and next migrate from standalone to distributed. And Zabbix reset counters and generate this bug (smaller new id than older id). Where zabbix store counters?

        Comment

        • Aly
          ZABBIX developer
          • May 2007
          • 1126

          #5
          Originally posted by sauron
          Our base contain eventid larger than new generated...
          This is definitely wrong!

          id counters stored in table ids
          Zabbix | ex GUI developer

          Comment

          • sauron
            Senior Member
            • Jan 2005
            • 215

            #6
            Originally posted by Aly
            This is definitely wrong!

            id counters stored in table ids
            Zabbix get max id in table?

            Comment

            • Aly
              ZABBIX developer
              • May 2007
              • 1126

              #7
              it stores max id per table.
              Zabbix | ex GUI developer

              Comment

              • sauron
                Senior Member
                • Jan 2005
                • 215

                #8
                Bah! Fixed. Thx for help.

                PS I'm think need check migration function. It's contain bugs.

                Comment

                Working...