Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-3019

In DM mode enabled template graphs not copied for discovered host

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.9.0 (alpha)
    • Fix Version/s: 1.8.4
    • Component/s: Frontend (F), Server (S)
    • Labels:
      None
    • Environment:
      Linux 2.6.34-gentoo-r1, PostgreSQL 8.4.4, whatever

      Description

      When Distributed Monitoring enabled there are no graphs for autodiscovered hosts. Debug mode helps to find what a problem is. It's all about function DBcopy_graph_to_host in svn/trunk/src/libs/zbxdbhigh/host.c. Function DBget_graphitems takes argument sql, prepared few lines ago like this:
      zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, 256,
      "select 0,dst.itemid,dst.key_,gi.drawtype,gi.sortorder,"
      and so on.

      In fact sql query was truncated like this:
      select 0,dst.itemid,dst.key_,gi.drawtype,gi.sortorder,gi.color,gi.yaxisside,gi.calc_fnc,gi.type,gi.periods_cnt from graphs_items gi,items i,items dst where gi.itemid=i.itemid and i.key_=dst.key_ and gi.graphid=100100000000391 and dst.hostid=10010000001035

      I can't see any "order by dst.key_" which is a part of query and also hostid is truncated: 10010000001035 instead of 100100000010350. I guess 256 is enough for non DM installations but makes a trouble when ids expanded with DM node id.

      Following modification worked for me [svn/trunk/src/libs/zbxdbhigh]:
      Index: host.c
      ===================================================================
      — host.c (revision 14504)
      +++ host.c (working copy)
      @@ -2732,7 +2732,7 @@
      name_esc = DBdyn_escape_string(name);

      sql_offset = 0;

      • zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, 256,
        + zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, 512,
        "select 0,dst.itemid,dst.key_,gi.drawtype,gi.sortorder,"
        "gi.color,gi.yaxisside,gi.calc_fnc,"
        "gi.type,gi.periods_cnt"

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ialx Alexander Ignatyev
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: