Adding graph via graph template does not add data sources
Moderators: Developers, Moderators
Adding graph via graph template does not add data sources
I am trying to figure out how to make my graph template automatically create data sources based on the data template.
I have had one graph template work partially like this, but ever since then, I cannot duplicate the results.
I want to add a graph to a device, select a data template, and have it automagically create the needed sources based on the data template defined.
Any help would be appreciated.
I have had one graph template work partially like this, but ever since then, I cannot duplicate the results.
I want to add a graph to a device, select a data template, and have it automagically create the needed sources based on the data template defined.
Any help would be appreciated.
[b][i]C[/i][/b]hz[b][i]D[/b][/i]hippt
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
This would require a device import feature request. Please place it in either the Feature Requests section of this forum or in Mantis. If you want to take a shot at it yourself, the code is GNU. This functionality is on our to-do list. However, it is not a top priority at this point.
TheWitness
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?
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?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Oh,
Ok. First things first.
Simple Script:
1) Create Script if Script (Perl, PHP, SH, VBS, etc.)
2) Create Data Input Method (if required)
3) Create Data Template (include all RRD DS' in Data Template)
4) Create Graph Template
Simple SNMP Query:
1) Create Data Template
2) Create Graph Template
Data Query:
1) Create XML File
2) Create Script if Script Driven
3) Create Data Template (include all RRD DS' in the Data Template)
4) Create Graph Template
All Data Sources will be created based upon the criterial set forth in the Data Template.
It just sounds simple. There are quite a few micro steps missing on associating script output, input, data sources, etc. to everything.
TheWitness
Ok. First things first.
Simple Script:
1) Create Script if Script (Perl, PHP, SH, VBS, etc.)
2) Create Data Input Method (if required)
3) Create Data Template (include all RRD DS' in Data Template)
4) Create Graph Template
Simple SNMP Query:
1) Create Data Template
2) Create Graph Template
Data Query:
1) Create XML File
2) Create Script if Script Driven
3) Create Data Template (include all RRD DS' in the Data Template)
4) Create Graph Template
All Data Sources will be created based upon the criterial set forth in the Data Template.
It just sounds simple. There are quite a few micro steps missing on associating script output, input, data sources, etc. to everything.
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?
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?
I did all of these things.. The first time I did it, it worked properly and created the DSs automatically when I created a host from the host template. Since then, I have been unable to duplicate the results. Instead, I manually must create my DSs (based on data templates) before making my host, then connect the DSs in the 2nd step of the host creation.TheWitness wrote:
Simple Script:
1) Create Script if Script (Perl, PHP, SH, VBS, etc.)
2) Create Data Input Method (if required)
3) Create Data Template (include all RRD DS' in Data Template)
4) Create Graph Template
All Data Sources will be created based upon the criterial set forth in the Data Template.
TheWitness
I will try re-building my stuff exactly in that order to see if it works then.
[b][i]C[/i][/b]hz[b][i]D[/b][/i]hippt
I have done the following, again with the same (apparently failing) results... (some things left for simplicity)
1) Write script that returns
So this works fine...
2) Created Data Input Method, with 2 output fields, named onhook, offhook, along with the proper input methods.
3) Created a Data Template, with 2 Data Source Items, called (for consistancy) onhook and offhook. On each of these items, I chose the respctive output field from the Data Input Method, which showed up after I changed the Data Input Method to my step 2 item, called "Get Sphere Hub Call Data"
4) Created a graph template called "Sphere Hub Call Details". Added the 2 graph Template Items I wanted to graph. Created the Graph Item Inputs, called OnHook Data Source, and OffHook Data Source, both type Datasource. I associated these with the Graph Template Items which they are for.
5) Created a host template called "Sphere Hub". Added the Associated Graph Template "Sphere Hub Call Details".
6) Add Device using Host Template "Sphere Hub"
Here is where it gets dicey.
7) Click "Create Graphs for this Host" at the top of the device.
Choose "Sphere Hub Call Details" for the graph type to create
This used to prompt for which Data Input Method Outputs to associate with which Graph Data Sources, but insted, it just Creates the graph.
1) Write script that returns
Code: Select all
#perl /usr/local/cacti/scripts/spherehub_count.pl public 10.8.248.85
onhook:20 offhook:3 totalcalls:3745
2) Created Data Input Method, with 2 output fields, named onhook, offhook, along with the proper input methods.
3) Created a Data Template, with 2 Data Source Items, called (for consistancy) onhook and offhook. On each of these items, I chose the respctive output field from the Data Input Method, which showed up after I changed the Data Input Method to my step 2 item, called "Get Sphere Hub Call Data"
4) Created a graph template called "Sphere Hub Call Details". Added the 2 graph Template Items I wanted to graph. Created the Graph Item Inputs, called OnHook Data Source, and OffHook Data Source, both type Datasource. I associated these with the Graph Template Items which they are for.
5) Created a host template called "Sphere Hub". Added the Associated Graph Template "Sphere Hub Call Details".
6) Add Device using Host Template "Sphere Hub"
Here is where it gets dicey.
7) Click "Create Graphs for this Host" at the top of the device.
Choose "Sphere Hub Call Details" for the graph type to create
This used to prompt for which Data Input Method Outputs to associate with which Graph Data Sources, but insted, it just Creates the graph.
[b][i]C[/i][/b]hz[b][i]D[/b][/i]hippt
While I don't completely remember the functionality that you are talking about here, this is supposed to be handled by the graph template. When you add items to a graph template, the data template item that you select for the Data Source field is important. This field is used to determine which data sources to create for the graph, and the exact data source item -> graph item mappings to use for the graph.chzdhippt wrote:This used to prompt for which Data Input Method Outputs to associate with which Graph Data Sources, but insted, it just Creates the graph.
One thing that did change between 0.8.5a and 0.8.6 is that Cacti no longer prompts you for the "index type" field when creating a graph based on a data query. I don't think this is directly related to your question though.
If there is something that I overlooked here, feel free to clarify and I will do my best to help.
-Ian
Well, I have a graph template.
In this graph template, I have some Graph Item Inputs, which are type datasource. These are the items I define when I create the graph. The actual Template Items have a datasource set to "None" since this is a graph template, and the datasource has not been created yet.
I have Data Templates which define the data source items for the Data source.
1) In order for my graphs to work properly, I have to do the following:
Add device based on host template (which has some graph templates attached).
2) Add Data sources for the device, based on the Data templates I have built.
3) Create graphs for the device, based on graph templates.
4) Edit the graph items and set the values for the "Graph Item Inputs"
At one time, not sure if I broke it or what, When I chose to create graphs from the templates (using Create graphs for this host item in device view), it prompted me for the supplemental graph data, which it then determine that there was data sources that needed to be created. It would create the data sources and associate the template inputes to the data sources.
Now, when I create a graph, it does not prompt me for the supplemental data, nor does it create the data sources (of course not, because it doesnt know which templates to use, since it didnt ask)
I would be happy to work with you on my live system (since its not a production system yet) to show you what I have and whats not doing what I would expect, so we can determine if I am losing my mind or if there is some type of bug.
This would be great, since I have another minor thing which I think is a bug that I dont know how to explain.
In this graph template, I have some Graph Item Inputs, which are type datasource. These are the items I define when I create the graph. The actual Template Items have a datasource set to "None" since this is a graph template, and the datasource has not been created yet.
I have Data Templates which define the data source items for the Data source.
1) In order for my graphs to work properly, I have to do the following:
Add device based on host template (which has some graph templates attached).
2) Add Data sources for the device, based on the Data templates I have built.
3) Create graphs for the device, based on graph templates.
4) Edit the graph items and set the values for the "Graph Item Inputs"
At one time, not sure if I broke it or what, When I chose to create graphs from the templates (using Create graphs for this host item in device view), it prompted me for the supplemental graph data, which it then determine that there was data sources that needed to be created. It would create the data sources and associate the template inputes to the data sources.
Now, when I create a graph, it does not prompt me for the supplemental data, nor does it create the data sources (of course not, because it doesnt know which templates to use, since it didnt ask)
I would be happy to work with you on my live system (since its not a production system yet) to show you what I have and whats not doing what I would expect, so we can determine if I am losing my mind or if there is some type of bug.
This would be great, since I have another minor thing which I think is a bug that I dont know how to explain.
[b][i]C[/i][/b]hz[b][i]D[/b][/i]hippt
Before I broke it, the process I used was:
1) Create device (select host template)
2) Choose "Create graphs for this host", in which it prompted me for the data sources for the graph item inputs I specified in the graph template)
and that was it. By specifying the supplemental graph data in step 2, it would create the data sources dictated by the templates.
1) Create device (select host template)
2) Choose "Create graphs for this host", in which it prompted me for the data sources for the graph item inputs I specified in the graph template)
and that was it. By specifying the supplemental graph data in step 2, it would create the data sources dictated by the templates.
[b][i]C[/i][/b]hz[b][i]D[/b][/i]hippt
As you demonstrated, you can create graph by manually creating the data sources, graphs, and then associating the two together. This is certainly the hard way of doing this though.chzdhippt wrote:1) In order for my graphs to work properly, I have to do the following:
Add device based on host template (which has some graph templates attached).
2) Add Data sources for the device, based on the Data templates I have built.
3) Create graphs for the device, based on graph templates.
4) Edit the graph items and set the values for the "Graph Item Inputs"
I am glad that you discovered the easier way of creating graphs from a graph template. I completely understand what you are trying to do here, however I don't understand how this ever worked for you. The "Data Source" field is an exception in that Cacti will not prompt you for a graph item input that has data source specified for the field type.chzdhippt wrote:At one time, not sure if I broke it or what, When I chose to create graphs from the templates (using Create graphs for this host item in device view), it prompted me for the supplemental graph data, which it then determine that there was data sources that needed to be created. It would create the data sources and associate the template inputes to the data sources.
I would be curious to hear what version of Cacti actually prompted you for the data source when creating a graph through the "New Graphs" page.
Like I said above, this behavior is intentional. In fact, I'd consider it a feature. When a user creates a graph template and goes to create a graph from that template, it would be confusing to have to manually assign the data sources. Instead it makes more sense to define this mapping in the graph template itself by mapping graph template items to data template items. This also means that it is possible to create a graph template without prompting the user for any information. This is beneficial to the user that might not know how to create graph templates but wants to create graphs based on pre-made templates for their devices.chzdhippt wrote:Now, when I create a graph, it does not prompt me for the supplemental data, nor does it create the data sources (of course not, because it doesnt know which templates to use, since it didnt ask)
-Ian
Who is online
Users browsing this forum: No registered users and 3 guests