variable for data source item ?

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Ricounet
Posts: 3
Joined: Thu Jul 18, 2013 10:53 am

variable for data source item ?

Post by Ricounet »

Hello all,

in cacti doc it is written in chapter 18 about variables :

"This variable, |data_source_title|, gets replaced with the name of the data source associated with a particular graph item in a graph template. This change allows the creation of generic graph templates (2-variable line graph, 3-variable stack, etc.) which can be reused with large numbers of data sources. See attached examples to understand usage."

I have a data source which contains multiple data source items, and I would like a variable for each data source item, so that I can use this variable in Text Format field of graph template item corresponding to data source item. Do such variables exist ?

Otherwise I will have to create many graph templates just to have the correct legend for my data source items...and I guess this is just what templates allow not to do !

Thanks for your help
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: variable for data source item ?

Post by BSOD2600 »

As you've read in http://docs.cacti.net/ only Data Query/Script templates with Input fields can have their variables used in graph/data template titles/text fields. There are several examples of this with the stock templates/scripts that come with Cacti.
Ricounet
Posts: 3
Joined: Thu Jul 18, 2013 10:53 am

Re: variable for data source item ?

Post by Ricounet »

BSOD2600 wrote:As you've read in http://docs.cacti.net/ only Data Query/Script templates with Input fields can have their variables used in graph/data template titles/text fields. There are several examples of this with the stock templates/scripts that come with Cacti.
Thank you, but then how can I create a single graph template if I cannot access data source items names through variables ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest