I upgraded to 0.8.7i and was able to use the input variables in my graph titles. However, they don't seem to work when I try to apply the same to a data template name. I copy & pasted the same string from the graph template's title to the data template's name. New data sources don't get the substitution, and there is also no change when I try to "Reapply Suggested Names" from the data source view. I don't know if this is intended behavior or if I have a local problem.
I looked at the SQL queries being made and there's one to the data_local table that has a condition with snmp_query_id > 0. Entries in that table for my data query in question have an id value = 0, so that one SQL query returns no rows. I'm only guessing at it's relevance.
Thanks,
Rick
Script Input Variables in Data Source Name
Moderators: Developers, Moderators
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Script Input Variables in Data Source Name
Not sure, but I suppose that there has been a custom patch (== not yet published officially) to the related code to apply input variables to DS as well. It's a singel function call, if I remember correctly.
This patch has been published to the forums by a educated user; please search
R.
This patch has been published to the forums by a educated user; please search
R.
Re: Script Input Variables in Data Source Name
For 0.8.7i, try adding this line to 'lib/functions.php':
(After you modified data template, perform "Reapply Suggested Names" if needed)
Thanks developers, that function (substitute_data_input_data) is very useful and generic!
Code: Select all
function get_data_source_title($local_data_id) {
...
if ((strstr($data["name"], "|")) && (!empty($data["host_id"]))) {
$data["name"] = substitute_data_input_data($data["name"], "", $local_data_id); // <--THIS LINE
return expand_title($data["host_id"], $data["snmp_query_id"], $data["snmp_index"], $data["name"]);
}else{
return $data["name"];
}
}
Thanks developers, that function (substitute_data_input_data) is very useful and generic!
Re: Script Input Variables in Data Source Name
Indeed, that modification to functions.php seems to have done the trick. Thank you for that.
Re: Script Input Variables in Data Source Name
Thanks reply. I posted this as a feature request.
- http://bugs.cacti.net/view.php?id=2165
- http://bugs.cacti.net/view.php?id=2165
Who is online
Users browsing this forum: No registered users and 1 guest