官术网_书友最值得收藏!

Chapter 3. Creating and Using Templates

Cacti provides a facility to create templates for data, graphs, and hosts. This chapter is going to explain how to create these templates and apply them to the devices.

This chapter is going to cover the following topics:

  • An introduction to templates
  • Defining a data template
  • Defining a graph template
  • Defining a host template
  • Assigning a host template to a device
  • Importing/exporting templates
  • References to the template repository

So let's get started…

An introduction to templates

Cacti has templates which can be used to simplify the process of creating and administering graphs, as well as assigning them to specific types of hosts. There are three different types of templates: graph, host, and data.

Data templates

Data templates describe the data which Cacti is going to store in the RRD files. This basically comes down to the RRDtool create command. Having a template for the RRDtool create command issued internally by Cacti assures you that RRD files based on this template are always created in a common way.

Please note that once a data template is being used to create an RRD file, changes to the data template will not be reflected on that RRD file.

Data input methods

Data templates are based on "Data Input Methods". Data input methods describe different methods for Cacti to retrieve data to be inserted into the data sources. There are different methods available to retrieve data. The most common ones are through executing external scripts or using SNMP.

Graph templates

Graph templates define the look and feel of a graph. They also provide the skeleton to the RRDtool graph function, defining the data sources to use and the graph items to display. Changes to a graph template get propagated to all graphs based on that template.

Host templates

Host templates are like shopping baskets for graph templates and data queries. Let's assume a specific device type should contain several different graphs. Instead of adding each single graph template and data query to each single device, you can simply define these within a host template and assign that host template to the device.

Unfortunately, changes to a host template do not get propagated down to the single devices.

Data queries

We just heard about "Data Queries", but what is it? A data query is a special way of retrieving indexed data such as a list of network interfaces or running processes on a Linux server. It consists of an XML file defining the location of the data to be retrieved and the actual method for retrieving it. In addition to the XML file, a data query also needs to be defined in Cacti in order for Cacti to map the data to an associated graph template.

主站蜘蛛池模板: 济阳县| 六盘水市| 岳西县| 仙桃市| 沂水县| 霍山县| 盐山县| 措勤县| 颍上县| 乐至县| 深泽县| 桐柏县| 上思县| 陵水| 县级市| 盱眙县| 筠连县| 包头市| 南平市| 永宁县| 宜兴市| 岳阳县| 门源| 太湖县| 来安县| 龙江县| 九江县| 察隅县| 文山县| 元谋县| 镇平县| 青浦区| 怀柔区| 社会| 涞源县| 延川县| 尼木县| 高要市| 南昌市| 丰台区| 和硕县|