-
Incident report
-
Resolution: Fixed
-
Critical
-
1.9.0 (alpha)
-
None
-
Linux 2.6.34-gentoo-r1, PostgreSQL 8.4.4, whatever
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"