Data Queries / Script Data / not being polled

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

Moderators: Developers, Moderators

ze
Posts: 9
Joined: Wed Feb 11, 2009 4:10 pm

Data Queries / Script Data / not being polled

Post by ze »

Hi,

I want to graph sessions per domains, so I created my own Data Query.

Data Query: Data Input Method: Get Script Data (Indexed)

I had to add my own DataTemplate to know what it is about...
Data Template: Data Input Method: Get Script Data (Indexed)
gauge, and all common stuffs.

created a graph, and added it to the dataquery, using the datatemplate as source, and associating it with my sessions.

I used the DataQuery on a host, which managed to find my sites properly.
I created the graphs for those sessions, it went well, creating the appropriate datasource and graphs...

BUT, even if the data source seems to be here, there is nothing in the poller cache that even try to get it, and i have no idea why...

I do see in SNMP cache that it managed to get site siteName, dbName, dbHost, ... but no informations about my sessions either.


xmlFile wrote:<query>
<name>MyQuery</name>
<description>Get Stats (sessions for now)</description>

<script_path>/bin/sh |path_cacti|/scripts/query_sessions.sh</script_path>

<!-- av[1] for specified action -->
<arg_index>index</arg_index> <!-- list of indexes -->
<arg_query>query</arg_query> <!-- list of values by fieldname -->
<arg_get>get</arg_get> <!-- value by fieldname/index -->
<arg_num_indexes>num_indexes</arg_num_indexes> <!-- index count -->

<output_delimeter>:</output_delimeter>
<index_order>siteName:site</index_order>
<index_order_type>alphanumeric</index_order_type>

<index_title_format>|siteName|</index_title_format>

<fields>
<site>
<name>Site</name>
<direction>input</direction>
<query_name>site</query_name>
</site>
<siteName>
<name>Site Name</name>
<direction>input</direction>
<query_name>siteName</query_name>
</siteName>

<dbName>
<name>Database Name</name>
<direction>input</direction>
<query_name>dbName</query_name>
</dbName>
<dbHost>
<name>Database Host</name>
<direction>input</direction>
<query_name>dbHost</query_name>
</dbHost>

<dbSessions>
<name>Sessions</name>
<direction>output</direction>
<query_name>sessions</query_name>
</dbSessions>


</fields>
</query>
scriptExemples wrote:$ ./script.sh index
site1
site2
$ ./script.sh query sessions
site1:42
site2:21
$ ./script.sh get sessions site1
42$ ./script.sh get sessions site2
21$

notes, if it might help: debian lenny, lastest updates.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please post output of Verbose Query
Reinhard
ze
Posts: 9
Joined: Wed Feb 11, 2009 4:10 pm

Post by ze »

Hi,

Here is the verbose query... if you think anything else might help, don't hesitate to ask.
(If it might help, I might be able to make a setup on a server for like 1-2 people to check directly.)
VerboseQuery wrote:+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh index'
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query site'
+ Found item [site='Site1'] index: Site1
+ Found item [site='Site2'] index: Site2
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query siteName'
+ Found item [siteName='Sitename site2'] index: Site1
+ Found item [siteName='Sitename site2'] index: Site2
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query dbName'
+ Found item [dbName='database1'] index: Site1
+ Found item [dbName='database2'] index: Site2
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query dbHost'
+ Found item [dbHost='10.10.12.10'] index: Site1
+ Found item [dbHost='10.10.22.12'] index: Site2
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Fine. For the next test, please change last <direction>output to "input" and re-run verbose query
Reinhard
ze
Posts: 9
Joined: Wed Feb 11, 2009 4:10 pm

Post by ze »

Good idea. That should help check it get some correct values.
Unfortunatly for me, it does, so that doesn't seem to be it...
VerboseQuery wrote:+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh index'
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query site'
+ Found item [site='Site1'] index: Site1
+ Found item [site='Site2'] index: Site2
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query siteName'
+ Found item [siteName='Sitename site1'] index: Site1
+ Found item [siteName='Sitename site2'] index: Site2
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query dbName'
+ Found item [dbName='database1'] index: Site1
+ Found item [dbName='database2'] index: Site2
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query dbHost'
+ Found item [dbHost='10.10.12.10'] index: Site1
+ Found item [dbHost='10.10.22.12'] index: Site2
+ Executing script query '/bin/sh /usr/share/cacti/site/scripts/query_myscript.sh query sessions'
+ Found item [dbSessions='58'] index: Site1
+ Found item [dbSessions='0'] index: Site2
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/myscript.xml'
I did set it back to output, so if you need to have it on input for the next tests, just state it so.

If you happen to have multiple ideas, don't hesitate to ask different tests, i don't mind spending some time testing more stuffs at once.

And thanks for helping out...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Ok.
Run the poller in debug mode to find out, if data was fetched from target (find help on debug mode at 2nd link of my sig).
See the Data Query, select the related Graph Template and verify, that the data sources used have their respective checkboxes checked.
Reinhard
ze
Posts: 9
Joined: Wed Feb 11, 2009 4:10 pm

Post by ze »

poller in debug mode : the host does not ever appear in it (no other data collected). Data not collected, script not run (also checked script access time).

Data source was not checked anymore (most likely since i did set it to "input" earlier for your tests). Checked it again, and ran the above tests again, same results.
ze
Posts: 9
Joined: Wed Feb 11, 2009 4:10 pm

Post by ze »

... one thing i just noticed while trying to just redo everything with new name, just to check there was not something bad in cache somewhere...

On datasources :
Custom Data
Index Type Data query data sources must be created through New Graphs.
Index Value [empty field]
Output Type ID Data query data sources must be created through New Graphs.

Any idea why ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

ze wrote:poller in debug mode : the host does not ever appear in it (no other data collected). Data not collected, script not run (also checked script access time).

Data source was not checked anymore (most likely since i did set it to "input" earlier for your tests). Checked it again, and ran the above tests again, same results.
But you did create some graphs for that host, did you?
Reinhard
ze
Posts: 9
Joined: Wed Feb 11, 2009 4:10 pm

Post by ze »

I made a "virtual" host with only those graph on 127.0.0.2, in order to gather just sessions in a single place.

There are already tons of graph generated for other stuffs though, just not for that one host.
ze
Posts: 9
Joined: Wed Feb 11, 2009 4:10 pm

Post by ze »

I tryed to reproduce it on an other cacti server, and it goes along the same lines...

I took screen-shot while i was working... maybe I can get it up to a howto once it does work. (for now, it is still a how not to...)

I have the same results as before. So, here you can see the exact steps i did, and how it not works. If you can point out at what I did wrong, i would appreciate...

http://cacti.hagtheil.net/howto/

(note: Version 0.8.7b, lastest debian/stable cacti version)

edit: fixed link to .xml and script sources
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

ze wrote:... one thing i just noticed while trying to just redo everything with new name, just to check there was not something bad in cache somewhere...

On datasources :
Custom Data
Index Type Data query data sources must be created through New Graphs.
Index Value [empty field]
Output Type ID Data query data sources must be created through New Graphs.

Any idea why ?
Oh, I dropped this post. It suggests, that the indexing stuff fails, but I can't see the reason
Reinhard
ze
Posts: 9
Joined: Wed Feb 11, 2009 4:10 pm

Post by ze »

I managed to make it run in my "tutorial" exemple, by changing just a little thing in the xml :

old: <index_order>Name</index_order>
new: <index_order>name</index_order>


Now for my more real production thing, i did not manage to deal with it as easily.
I ended up commenting completly this part :
<index_order>siteName:site</index_order>
<index_order_type>alphanumeric</index_order_type>
I tryed different things to get it to work, without success, so I'm not sure how it is supposed to work exactly, and how I did it wrong...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I can't make any sense out of it but I appreciate your posting. It makes me think ...
Reinhard
User avatar
calh
Posts: 15
Joined: Mon Mar 09, 2009 12:32 pm
Location: Fargo, ND

Post by calh »

Hi all,

I'm having this exact same problem with a data query I created. My script and XML file seems fine compared to the examples (although a lot more content) But after creating the graph for the host, the poller does not create the RRD file or call the script.

Did anyone find out the cause / solution for this problem?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests