Ad Widget

Collapse

Zabbix 1.4.1: Housekeeper

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

    #1

    Zabbix 1.4.1: Housekeeper

    Found that the trends table in the database did not have an index on "itemid" and "clock" so I add an index to speed up housekeeping the table "trends".

    Also, in housekeeper.c I found 2 duplicate entries for the same table. It looks like one was suppose to be history_text

    Before:
    while((row=DBfetch(result)))
    {
    ZBX_STR2UINT64(item.itemid,row[0]);
    item.history=atoi(row[1]);
    item.trends=atoi(row[2]);

    deleted += delete_history("history", item.itemid, item.history, now);
    deleted += delete_history("history_uint", item.itemid, item.history, now);
    deleted += delete_history("history_str", item.itemid, item.history, now);
    deleted += delete_history("history_str", item.itemid, item.history, now);
    deleted += delete_history("history_log", item.itemid, item.history, now);
    deleted += delete_history("trends", item.itemid, item.trends, now);
    }
    DBfree_result(result);
    After:
    while((row=DBfetch(result)))
    {
    ZBX_STR2UINT64(item.itemid,row[0]);
    item.history=atoi(row[1]);
    item.trends=atoi(row[2]);

    deleted += delete_history("history", item.itemid, item.history, now);
    deleted += delete_history("history_uint", item.itemid, item.history, now);
    deleted += delete_history("history_str", item.itemid, item.history, now);
    deleted += delete_history("history_text", item.itemid, item.history, now);
    deleted += delete_history("history_log", item.itemid, item.history, now);
    deleted += delete_history("trends", item.itemid, item.trends, now);
    }
    DBfree_result(result);
    return deleted;
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Originally posted by Palmertree
    Found that the trends table in the database did not have an index on "itemid" and "clock" so I add an index to speed up housekeeping the table "trends".
    Both itemid and clock are part of primary key of the table!

    Thanks for pointing to history_text. Fixed.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    Working...