OK Cacti gurus, here is one for you. I ran into a strange problem with templates and I was wondering if someone could answer a few questions for me. I will try to explain as best as I can which means this may be a little winded so please bear with me.
I have encountered a problem with using templates in cacti. I ran into this problem when trying out the templates for WeatherBug, AccuWeather, and even my own templates for Weather Underground, however I think that you may run into this problem with any template that references multiple graphs to a single RRD file. Basically, what happens is when you create graphs from a host template, an RRD file gets created for each of the graphs created. OK, so what is the problem? Well, one script, WeatherBug.pl for this example, goes out to a web site and pulls seven pieces of information which gets mapped to seven data sources in a single RRD file. By the host template creating an RRD file for each of the graphs, in this case five different graphs to display all of the data, the poller then runs the same script five times to populate each of the five RRD files with the same data. I see some problems with this; First, running the same script five times to populate five RRD files with the same seven pieces of information seems like a performance hit for the cacti application. Second, I have found that when opening up multiple connections to a URL you sometimes run into throttling, especially during high loads on the remote server, where only one of the requests from the poller will be answered and the rest time out or get ignored. This results in gaps in graphing the data. So far the only way I have found to properly map several graphs to a single RRD file is to forget about templates and manually create the RRD file under "Console -> Data Sources" and manually create the graphs under "Console -> Graph Management" So now for the questions.
1. Is there a way to define the name of the RRD file that you will use in a "Data Template"?
2. Under "Graph Templates" you map the data source that you wish that graph to use but there seems to be no what to tell the graph template to check for an RRD file that may already contain that DS. Did I miss something?
3. Templates are a great way to move a configuration from one machine to another, but if I don't use the templates how do I export all of that typing/clicking that I did under "Graph Management" and "Data Sources" to a file in order to move the configuration to another server or just plain disaster recovery?
4. It appears that if the script returns invalid data it is not run again. Did I miss something?
For everything above I am running,
- Cacti v0.8.6h
- FreeBSD v5.x
- Apache v2.2.2
- PHP v5.1.4
- MySQL v5.1.9
But I have also seed the same problem on Ubunto v6.0.6 as well as others on that platform.
Any thoughts are appreciated
Thanks,
Tim
Template Bug or Misunderstanding?
Moderators: Developers, Moderators
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Template Bug or Misunderstanding?
This is a "well know", but bad behaviour of cacti.thogan wrote:I have encountered a problem with using templates in cacti. I ran into this problem when trying out the templates for WeatherBug, AccuWeather, and even my own templates for Weather Underground, however I think that you may run into this problem with any template that references multiple graphs to a single RRD file. Basically, what happens is when you create graphs from a host template, an RRD file gets created for each of the graphs created. OK, so what is the problem? Well, one script, WeatherBug.pl for this example, goes out to a web site and pulls seven pieces of information which gets mapped to seven data sources in a single RRD file. By the host template creating an RRD file for each of the graphs, in this case five different graphs to display all of the data, the poller then runs the same script five times to populate each of the five RRD files with the same data. I see some problems with this; First, running the same script five times to populate five RRD files with the same seven pieces of information seems like a performance hit for the cacti application. Second, I have found that when opening up multiple connections to a URL you sometimes run into throttling, especially during high loads on the remote server, where only one of the requests from the poller will be answered and the rest time out or get ignored.
If you're aware of this fact, you may proceed as follows:
Create the first Graph using "Create Graphs for this Host" as usual.
Create all following graphs from Graph Management. ADD a new Graph, select Graph Template and Host. Now you're presented with a dropdown list holding all knows data sources for this host. Associate them with the data sources required by the Graph Template and you're done. This procedure does not create new rrd's
It's tedious, but works
Reinhard
Who is online
Users browsing this forum: No registered users and 0 guests