Variable number of fieldnames

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

Moderators: Developers, Moderators

Post Reply
Entity
Posts: 9
Joined: Sat Oct 02, 2004 12:44 pm

Variable number of fieldnames

Post by Entity »

I have a script that has a variable number of fieldnames and values as output. E.g fieldname1:value1 to fieldnameN:valueN with N = variable
Is it possible to setup a query and a data source which automatically adapts to the variable number of output fields and uses the name of these output fields to graph them with a specified template?

Thanks for any help,

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

Post by gandalf »

As far as I'm concerned: no. But you may leave this for the experts.
But what are you trying to do? There was a post similar to this; it resolved to be hostnames that made up for the output. In this case it would be better to hand a single hostname to the script and make it return only a single value. The script should the be applied to all hosts (via a Data Input Method, Data Template and Graph Template, as usual)
Reinhard
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Problem being you would have to accound for the minimum DS' to include the whole set. Therefore, if you have to account for 10 DS' and only have 1 or 2 in use, you have either 90% or 80% wasted space in your RRD file. Otherwise, it should work. Note however, that if you create AREA graphs based upon the values, bad news.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Entity
Posts: 9
Joined: Sat Oct 02, 2004 12:44 pm

Post by Entity »

Thanks for the input. I'm trying but had no real success sofar.
TheWitness wrote:Problem being you would have to accound for the minimum DS' to include the whole set. Therefore, if you have to account for 10 DS' and only have 1 or 2 in use, you have either 90% or 80% wasted space in your RRD file. Otherwise, it should work. Note however, that if you create AREA graphs based upon the values, bad news.
I think I have missed to point to an important detail in my question. I would like to have each fieldname:value pair in a separate graph.
The data source basically is a small perl script which queries a sql database and returns N fieldname:value pairs as result for this query.
The range of N varies +/-4 but there are also new fieldname:value pairs, whereas old ones drop out.
The goal is to keep maintanance of the solution to the lowest possible level so I'm searching for a solution, which just adds an own graph for each result returned by the query.

Best regards,

Entity
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests