Please explain design of data queries

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

Moderators: Developers, Moderators

Post Reply
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Please explain design of data queries

Post by goldburtd »

Has anyone been sucessful in writing a data query that uses a data input method other than the pre-defined ones (Get Script Data (Indexed), Get SNMP Data (Indexed), or Get Script Server Data (Indexed))??

I would like to have a discussion with the Cacti developers/designers responsible for the data query functionality. Don't get me wrong - it works great in delivering a sorely needed capability (easily collect data without knowing the exact interfaces on a machine, for example). However, I think the design makes it very inflexible.

My main qualm is that a data query replaces a data input method. The definition in the documentation
Data queries are not a replacement for data input methods in Cacti. Instead they provide an easy way to query, or list data based upon an index, making the data easier to graph.
claims otherwise. However, it doesn't seem to me to be implemented that way. A data query xml file must specify output parameters, and either snmp or an associated script must implement the data retrieval (by handling an arg_get parameter). It would be nice if a data input method could be used to do the data retrieval. I just want the data query to assist the user in creating the data sources - as the definition suggests.

Lastly, you can look at the database tables. They still have names like "snmp_query" even though they may hold data about script queries. This indicates to me that data queries were designed to address indexed oid's. Thus when lvm tried to write a tutorial on script data queries, he could only really transform the regular snmp query for interfaces into one that does the same thing, only with scripts.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Post by goldburtd »

Thanks, but lvm is using an existing data input method:
Select Get SNMP Data (Indexed) as Data Input Method
I'm not using SNMP to get the data, I'm using a script. I want my script to be encapsulated in its own data input method, and not have to be all wrapped up in a data query. In other words, I want to create a data query but have one script handle the "index" and "query" commands, and another script execute the "get" command. Its restrictive having to write a script that does all three.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please see my contrib at http://docs.cacti.net/node/70
Reinhard
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Post by goldburtd »

Dude, I've read your howto's. All your data queries use standard input methods (those ending with "(Indexed)").

Please read my post a bit more carefully. I even linked to your latest howto on script queries. It uses the "Get Script Data (Indexed)" input method.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

goldburtd wrote:Thanks, but lvm is using an existing data input method:
Select Get SNMP Data (Indexed) as Data Input Method
I'm not using SNMP to get the data, I'm using a script. I want my script to be encapsulated in its own data input method, and not have to be all wrapped up in a data query. In other words, I want to create a data query but have one script handle the "index" and "query" commands, and another script execute the "get" command. Its restrictive having to write a script that does all three.
Guess what, you will have to write that "restrictive" script you don't like.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Post by goldburtd »

Ok, no problem. btw I don't mean to seem ungrateful - you guys have done a great job with cacti.

But do you think I could get the concession of you admiting that data queries in fact do replace data input methods?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

goldburtd wrote:Ok, no problem. btw I don't mean to seem ungrateful - you guys have done a great job with cacti.

But do you think I could get the concession of you admiting that data queries in fact do replace data input methods?
Not meaning you were ungarteful. But due to my lack of current english, I may misunderstand some items.
As I understand your last sentence, I would disagree. If you have a look at the few images at e.g. http://docs.cacti.net/node/121, Data Input Methods are used for non-indexed data retrieval. And Data Queries are used for indexed ones.
Reinhard
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Post by goldburtd »

lvm wrote: As I understand your last sentence, I would disagree. If you have a look at the few images at e.g. http://docs.cacti.net/node/121, Data Input Methods are used for non-indexed data retrieval. And Data Queries are used for indexed ones.
Reinhard
Then the definition is misleading. Anyway, I don't want to turn this issue into semantics. I just would like to recommend a redesign of data queries so that all they do is list the data. Then you would create a data input method that actually polls the data.

For example, in the xml for a script query you have to specify the path to a script. I propose that this script handle the index and query commands. Then you use a data input method to specify how the get command is executed. As I understand it, the current Get Script Data (Indexed) method hard-wires a call to the same script specified in the query xml. This is very inflexible, as I may want to specify other arguments, or even use a different script altogether.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

goldburtd wrote:
lvm wrote: As I understand your last sentence, I would disagree. If you have a look at the few images at e.g. http://docs.cacti.net/node/121, Data Input Methods are used for non-indexed data retrieval. And Data Queries are used for indexed ones.
Reinhard
Then the definition is misleading. Anyway, I don't want to turn this issue into semantics. I just would like to recommend a redesign of data queries so that all they do is list the data. Then you would create a data input method that actually polls the data.

For example, in the xml for a script query you have to specify the path to a script. I propose that this script handle the index and query commands. Then you use a data input method to specify how the get command is executed. As I understand it, the current Get Script Data (Indexed) method hard-wires a call to the same script specified in the query xml. This is very inflexible, as I may want to specify other arguments, or even use a different script altogether.
Why have an alternate method of query when the script can do it. If you look at snmp data queries that is what is happening. We try to be very generic about our processes so the apply to many things.

Scripts are great, because you can write your own. I don't like putting my foot down, but to use data queries with scripts, you have to follow how Cacti does it.

To be blunt, this is open source, if you don't like the way something works, crack it open and change it.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Post by goldburtd »

rony wrote:To be blunt, this is open source, if you don't like the way something works, crack it open and change it.
Excellent answer! I think I just forgot that I have the source code. Too long working with proprietary monsters...
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Btw, submit a patch and we will review it for inclusion. :)
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests