variables in graph titles
Moderators: Developers, Moderators
variables in graph titles
I am trying to change an RTT graph template to set the Owner name of the RTT automaticly in the graph title (like the |host_description| variable).
is it possible?
is it possible?
what do you mean?
it fetches it from the router
Are you using a data query or did you just create a data input method to fetch this data from the router? Old versions of Cacti used to let you put variables on the graph for any data input method field. I removed this feature in 0.8 for SQL performance reasons. Somehow I need to find a good way to re-add this feature because it's really useful and I have a feeling that this would solve your problem.
If in fact you are using a data query, you are in luck. Data query variables are supported in the following format in graph titles:
-Ian
If in fact you are using a data query, you are in luck. Data query variables are supported in the following format in graph titles:
Code: Select all
|query_FIELDNAME|
i am using a data query, but it doesn't seem to work (i.e. the graph isn't accepting |query_FIELDNAME|. it doesn't parse it.)raX wrote:Are you using a data query or did you just create a data input method to fetch this data from the router? Old versions of Cacti used to let you put variables on the graph for any data input method field. I removed this feature in 0.8 for SQL performance reasons. Somehow I need to find a good way to re-add this feature because it's really useful and I have a feeling that this would solve your problem.
If in fact you are using a data query, you are in luck. Data query variables are supported in the following format in graph titles:
-IanCode: Select all
|query_FIELDNAME|
I should have been more clear. Literally putting |query_FIELDNAME| in your graph title won't work. You need to substitute "FIELDNAME" with an actual input field name from your data query. For example, field names for the interface data query (interface.xml) are "ifIndex", "ifAlias", "ifIP", etc.falcon10 wrote:i am using a data query, but it doesn't seem to work (i.e. the graph isn't accepting |query_FIELDNAME|. it doesn't parse it.)
-Ian
I know and that's what i did, and it still didn't workraX wrote:I should have been more clear. Literally putting |query_FIELDNAME| in your graph title won't work. You need to substitute "FIELDNAME" with an actual input field name from your data query. For example, field names for the interface data query (interface.xml) are "ifIndex", "ifAlias", "ifIP", etc.falcon10 wrote:i am using a data query, but it doesn't seem to work (i.e. the graph isn't accepting |query_FIELDNAME|. it doesn't parse it.)
-Ian
Anonymous wrote:I know and that's what i did, and it still didn't workraX wrote:I should have been more clear. Literally putting |query_FIELDNAME| in your graph title won't work. You need to substitute "FIELDNAME" with an actual input field name from your data query. For example, field names for the interface data query (interface.xml) are "ifIndex", "ifAlias", "ifIP", etc.falcon10 wrote:i am using a data query, but it doesn't seem to work (i.e. the graph isn't accepting |query_FIELDNAME|. it doesn't parse it.)
-Ian
correction - i tried using a fieldname that didn't exist. |query_rttMonCtrlAdminOwner| works great.
Re: Variables
It's certainly on my TODO. Kind of related to this, there is a user that is experimenting with XML interaction between scripts and Cacti. This would enable a script to return all sorts of data to Cacti which can then be displayed alongside the graph. Sound cool or what?ottob wrote:is there anything new about "Data Input Variables" in Graph or Datasource Titles?
-Ian
Who is online
Users browsing this forum: No registered users and 0 guests