Data Query Problem

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
ricardcc
Posts: 4
Joined: Thu Feb 17, 2011 3:22 pm

Data Query Problem

Post by ricardcc »

Hello,

i'm working about a Data Query that extracts information of a csv file by means of perl script.

This csv file contains a numerical index and a description detached by TAB key.

I created a script and a xml file, but seems that Cacti doesn't accept output script, or maybe xml file is not valid.

An example of my CSV file is:

Code: Select all

1       aaaaaaa
2       bbbbbbb
3       ccccccc
Script output:
1
2
3
when script is called with index

1:1
2:2
3:3
when script is called with query index

1:aaaaaaa
2:bbbbbbb
3:ccccccc
when script is called with query pipename


aaaaaaa
when script is calld with get 1


my xml file is:

Code: Select all

<query>
        <name> Pipes Allot </name>
        <description> Extreu pipes disponibles en fitxers csv d'Allot </description>
        <script_path> perl |path_cacti|/scripts/allot_pipes.pl </script_path>
        <arg_index>index</arg_index>
        <arg_query>query</arg_query>
        <arg_get>get</arg_get>
        <output_delimeter>:</output_delimeter>
        <index_order>index</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
        <fields>
                <id>
                        <name>Index</name>
                        <direction>input</direction>
                        <query_name>index</query_name>
                </id>
                <nompipe>
                        <name>Pipe</name>
                        <direction>input</direction>
                        <query_name>pipename</query_name>
                </nompipe>
        </fields>
</query>
When I try a data query from cacti, it shows:
Data Query Debug Information
+ Running data query [15].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/cacti/resource/script_queries/allot_pipes.xml'
+ XML file parsed ok.
+ Executing script for list of indexes ' perl /var/www/cacti/scripts/allot_pipes.pl index'
+ Executing script query ' perl /var/www/cacti/scripts/allot_pipes.pl query index'
+ Executing script query ' perl /var/www/cacti/scripts/allot_pipes.pl query pipename'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/allot_pipes.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/allot_pipes.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/allot_pipes.xml'
Can you help me? What is wrong?

Thanks.
ricardcc
Posts: 4
Joined: Thu Feb 17, 2011 3:22 pm

Re: Data Query Problem

Post by ricardcc »

Hello,

it seems that problem was cacti poller. Although we click on verbose query, data is not queried while poller is inactive. My script and xml file works fine. :lol:

Regards.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests