script query data template

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
deanpence
Posts: 13
Joined: Wed Feb 16, 2005 11:55 am

script query data template

Post by deanpence »

I've created a data query (using the Script Query input method). I create the data and graph templates, and then from the "Data Query" editing screen for that data query, I click on the associated graph template, and I get the following error under "Associated Data Templates":

Code: Select all

Warning: Variable passed to each() is not an array or object in /var/www/localhost/htdocs/cacti/data_queries.php on line 312
Any ideas? Here's my XML file, just in case:

Code: Select all

<interface>
   <name>Get Hosts' Memory Metrics</name>
   <description>Queries a host and gets memory metrics.</description>
   <script_path>|path_cacti|/scripts/cacti-query-memory</script_path>
   <arg_index>index</arg_index>
   <arg_query>query</arg_query> 
   <arg_get>get</arg_get>
   <arg_num_indexes>num_indexes</arg_num_indexes>
   <output_delimeter>/</output_delimeter>
   <index_order>host</index_order>
   <index_order_type>alphabetic</index_order_type>
   <index_title_format>|chosen_order_field|</index_title_format>

   <fields>
      <myHost>
         <name>Hostname</name>
         <direction>input</direction>
         <query_name>host</query_name>
      </myHost>

      <myMetric1>
         <name>Metric 1</name>
         <direction>output</direction>
         <query_name>metric1</query_name>
      </myMetric1>
      <myMetric2>
         <name>Metric 2</name>
         <direction>output</direction>
         <query_name>metric2</query_name>
      </myMetric2>
   </fields>
</interface>
deanpence
Posts: 13
Joined: Wed Feb 16, 2005 11:55 am

Post by deanpence »

Also, if I try to run a Verbose Data Query in an associated device, I get a PHP error (the first line is repeated several times):

Code: Select all

Warning: preg_match() [function.preg-match]: Unknown modifier '(' in /var/www/localhost/htdocs/cacti/lib/data_query.php on line 115

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/cacti/lib/data_query.php:115) in /var/www/localhost/htdocs/cacti/host.php on line 75
Jyrinx
Posts: 2
Joined: Fri Mar 11, 2005 5:14 pm

Post by Jyrinx »

I'm having precisely the same problem; my XML file is of exactly the same form (though the fields and data are different).
Jyrinx
Posts: 2
Joined: Fri Mar 11, 2005 5:14 pm

Post by Jyrinx »

Jyrinx wrote:I'm having precisely the same problem; my XML file is of exactly the same form (though the fields and data are different).
Wow ... okay, I now know the XML file can't have been the problem. Turns out I was silly enough to spell "delimiter" correctly in the tag. That's a hell of an API bug ...
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests