data query (script) problems

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

data query (script) problems

Post by deanpence »

Is there any other documentation on scripted data queries besides what's in the Cacti manual? The manual seems to be written in the spirit of after-you-already-understand-the-concepts-here's-how-to-use-cacti. Well, it'd be nice to have an in-depth explanation of how cacti runs scripted data queries. I'm writing a custom data query and, while my XML file seems correct, I'm not sure of the exact behavior cacti expects from my script.

Basically I've got a script that gets one type of data (from a proprietary server application) based on hostname and a metric name (e.g., "users", "accesses", etc.). Any particular metric value is only uniquely identifiable with both the hostname and the metric name. Does this violate cacti's way of doing queries?

As I understand it, assuming that I have two input fields ("hostname" and 'metric") and one output field ("memory") defined in the XML file, my script should respond like the following (with ':' as the field separator):

"index" argument:

Code: Select all

> script index
hostname0
hostname1
hostname2
...
"query hostname" argument:

Code: Select all

> script query hostname
hostname0:hostname0
hostname1:hostname1
hostname1:hostname1
...
"query metric" argument:

Well, after looking at the included query_unix_partitions.pl, it looks like there should be a one-to-one relationship between index and number of output lines here, but I don't have one. For each hostname, I have numerous metrics, so what would I output? One line for each hostname:metricname:metricvalue?

And I don't understand what the "get" is for either (in this particular case). In query_unix_partitions.pl, there is only one required input field (the last argument). In my case, I require two input values (hostname and metricname) to get an individual result.

Anyone care to explain?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests