Data Queries / Script Data / not being polled

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

Moderators: Moderators, Developers

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

Data Queries / Script Data / not being polled

#1 Post by ze » Wed Feb 11, 2009 4:23 pm

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#2 Post by gandalf » Thu Feb 12, 2009 4:03 pm

Please post output of Verbose Query
Reinhard

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

#3 Post by ze » Fri Feb 13, 2009 3:56 am

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#4 Post by gandalf » Fri Feb 13, 2009 2:53 pm

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

#5 Post by ze » Sat Feb 14, 2009 4:26 am

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#6 Post by gandalf » Sat Feb 14, 2009 7:34 am

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

#7 Post by ze » Sun Feb 15, 2009 12:17 pm

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

#8 Post by ze » Sun Feb 15, 2009 12:46 pm

... 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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#9 Post by gandalf » Sun Feb 15, 2009 1:01 pm

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

#10 Post by ze » Mon Feb 16, 2009 1:30 pm

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

#11 Post by ze » Mon Feb 16, 2009 2:53 pm

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#12 Post by gandalf » Tue Feb 17, 2009 1:48 pm

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

#13 Post by ze » Wed Feb 18, 2009 4:25 am

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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#14 Post by gandalf » Fri Feb 20, 2009 3:19 pm

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

#15 Post by calh » Tue Mar 31, 2009 5:07 pm

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