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
...
Code: Select all
> script query hostname
hostname0:hostname0
hostname1:hostname1
hostname1:hostname1
...
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?