I've written a perl script which accepts "index", "query", and "get" arguments, and produces what I think is the correct output. I've also put together an appropriate XML file and I can run the data query, with Cacti giving the right number of rows as the output.
Following on from that, I've built a data template to record all the data, and a graph template (first of two I intended to create). All went fine until I got as far as trying to actually create the graphs. I selected the items from the list that I wanted to graph, and hit create. I then got an error message sent back to the browser saying:-
Code: Select all
Notice: Undefined index: sgg_14 in /usr/share/cacti/site/graphs_new.php on line 71
Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/graphs_new.php:71) in /usr/share/cacti/site/graphs_new.php on line 322
Code: Select all
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select graph_template_id from snmp_query_graph where id="
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_template.name as data_template_name, data_template_rrd.data_source_name, data_template_data.* from (data_te
mplate, data_template_rrd, data_template_data, graph_templates_item) where graph_templates_item.task_item_id=data_template_rrd.id and data_template_rrd.data_template_id=data_template.id and
data_template_data.data_template_id=data_template.id and data_template_rrd.local_data_id=0 and data_template_data.local_data_id=0 and graph_templates_item.local_graph_id=0 and graph_templ
ates_item.graph_template_id= group by data_template.id order by data_template.name"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed "select graph_templates.name as graph_template_name, graph_templates_graph.* from (graph_templates, graph_templates_graph)
where graph_templates.id=graph_templates_graph.graph_template_id and graph_templates.id= and graph_templates_graph.local_graph_id=0"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select name from graph_templates where id="
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed "select * from graph_templates_graph where graph_template_id= and local_graph_id=0"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select * from graph_template_input where graph_template_id= order by column_name,name"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select graph_template_id from snmp_query_graph where id="
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "update graph_local set graph_template_id= where id=163"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed "select * from graph_templates_graph where local_graph_id=0 and graph_template_id="
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select * from graph_templates_item where local_graph_id=0 and graph_template_id= order by sequence"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select graph_template_input.column_name, graph_template_input_defs.graph_template_item_id from (graph_template_input,graph_templ
ate_input_defs) where graph_template_input.id=graph_template_input_defs.graph_template_input_id and graph_template_input.graph_template_id="
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select text,field_name from snmp_query_graph_sv where snmp_query_graph_id= order by sequence"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_template.id, data_template.name, data_template_rrd.data_source_name from (data_template, data_template_rrd, graph_t
emplates_item) where graph_templates_item.task_item_id=data_template_rrd.id and data_template_rrd.data_template_id=data_template.id and data_template_rrd.local_data_id=0 and graph_templates_item.
local_graph_id=0 and graph_templates_item.graph_template_id= group by data_template.id order by data_template.name"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select graph_templates_item.id, data_template_rrd.id as data_template_rrd_id, data_template_rrd.data_template_id from (graph_te
mplates_item,data_template_rrd) where graph_templates_item.task_item_id=data_template_rrd.id and graph_templates_item.graph_template_id= and local_graph_id=0 and task_item_id>0"
07/31/2006 04:24:08 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=d
ata_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_co
de='output_type')"
Mike[/code]