Ad Widget

Collapse

Zabbix 1.5.4 rev. 5792 - DM and Trends Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Palmertree
    Senior Member
    • Sep 2005
    • 746

    #1

    Zabbix 1.5.4 rev. 5792 - DM and Trends Table

    In a DM environment, the child will eventually stop pushing trend data back to the master node.

    The problem was due to the fact the the itemid and clockid were not ordered in the correct order. When the child node ask the master node what was his last record in the trends database for the child, the highest itemid plus clock was returning back instead of the highest clock plus itemid. This was due to the fact that the lastid and clock were ordered on itemid first and clock second in DES order. Should be the other way around. Also, the logic in the nodewatcher/history.c had to be changed some. Please see edits below.

    Code:
    diff -ruN zabbix-original/src/zabbix_server/trapper/nodehistory.c zabbix/src/zabbix_server/trapper/nodehistory.c
    --- zabbix-original/src/zabbix_server/trapper/nodehistory.c     2008-06-20 08:49:12.000000000 -0400
    +++ zabbix/src/zabbix_server/trapper/nodehistory.c      2008-06-26 00:08:10.000000000 -0400
    @@ -177,7 +177,7 @@
    
            tmp_offset= 0;
            zbx_snprintf_alloc(&tmp, &tmp_allocated, &tmp_offset, 256, "select itemid,clock "
    -               "from %s where 1=1" DB_NODE " order by itemid desc,clock desc",
    +               "from %s where 1=1" DB_NODE " order by clock desc,itemid desc",
                    tablename,
                    DBnode("itemid", nodeid));
    diff -ruN zabbix-original/src/zabbix_server/nodewatcher/history.c zabbix/src/zabbix_server/nodewatcher/history.c
    --- zabbix-original/src/zabbix_server/nodewatcher/history.c     2008-06-20 08:49:12.000000000 -0400
    +++ zabbix/src/zabbix_server/nodewatcher/history.c      2008-06-26 00:05:18.000000000 -0400
    @@ -210,11 +210,11 @@
                    clock -= clock % 3600;
    
                    zbx_snprintf_alloc(&tmp, &tmp_allocated, &tmp_offset, 1024, " from %s where"
    -                       " (itemid>"ZBX_FS_UI64" or (itemid="ZBX_FS_UI64" and clock>%d)) and clock<%d"
    -                       DB_NODE " order by itemid,clock",
    +                       " (itemid>"ZBX_FS_UI64" and clock=%d" DB_NODE ") or (clock>%d and clock<%d" DB_NODE ")"
    +                       " order by clock,itemid",
                            table->table,
    -                       lastid, lastid, lastclock, clock,
    -                       DBnode("itemid", nodeid));
    +                       lastid, lastclock, DBnode("itemid", nodeid),
    +                       lastclock, clock, DBnode("itemid", nodeid));
            } else { /* ZBX_HISTORY */
                    zbx_snprintf_alloc(&tmp, &tmp_allocated, &tmp_offset, 1024, " from %s where %s>"ZBX_FS_UI64
                            DB_NODE " order by %s",
    Last edited by Palmertree; 26-06-2008, 07:56.
Working...