Chapter 4. Creating and Using Templates
Cacti stores all collected information via RRDTool into files called rra. The RRDTool requires some parameters in order to create these rra files. Whenever we want to add a new device or create a new graph, we have to input these parameters. Inputting these parameters manually is flexible, but not very user friendly, and there is always a chance of error. Using templates, we can easily overcome this problem.
For example, let's say we have a network of four Linux servers, two Unix servers, and one Cisco router. Here, if we use a template, we will need to make only three different templates: one for the Linux servers, one for the Unix servers, and one for the Cisco router. You may ask why we have to make a template for the Cisco router? We will make it so that we can use it later.
Cacti templates can be imported and exported via the Console under Import/Export. You can only import templates that have been created on a system that is at the same, or an...
Cacti templates are broken into two areas:
1. Graph templates
2. Host templates
In the above figure, under the Templates section, you will see the three types of templates that come with the Cacti basic installation. If you click on one of those links, you will get the complete list of templates for that type.
Graphs are used to visualize the data you have collected. A graph template provides a skeleton for an actual graph. When you have more then one system/device, a graph template will save you lots of time and also reduce the possibility of error. Any parameters defined within a graph template are copied to all the graphs that are created using this template.
Creating a graph template
Now, we are going to create a new graph template. Under the Templates heading, click on Graph Templates. A list of the already available graph templates will be shown. Click on the Add link in the top right corner. You will get a screen like this:
Here, you have...
In this chapter, we learned about templates. Now, you can create or edit a graph template and host template. It's always a good practice to test every template locally before adding it to a production server. Also, we learned to how to import and export Cacti templates.