1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1st August 2004), see www.w3.org">
<title>Data Templates</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
<link rel="HOME" title="The Cacti Manual" href="index.html">
<link rel="UP" title="Templates" href="templates.html">
<link rel="PREVIOUS" title="Templates" href="templates.html">
<link rel="NEXT" title="Host Templates" href="host_templates.html">
<link rel="STYLESHEET" type="text/css" href="manual.css">
</head>
<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th colspan="3" align="center">The Cacti Manual</th>
</tr>
<tr>
<td width="10%" align="left" valign="bottom"><a href="templates.html" accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 11. Templates</td>
<td width="10%" align="right" valign="bottom"><a href="host_templates.html" accesskey="N">Next</a></td>
</tr>
</table>
<hr align="left" width="100%">
</div>
<div class="SECT1">
<h1 class="SECT1"><a name="DATA_TEMPLATES" id="DATA_TEMPLATES">Data Templates</a></h1>
<p>In Cacti, a data template provides a skeleton for an actual data source. If you have many data sources that share most of their characteristics, using a data template would probably make sense. After a data source is attached to a particular data template, all changes made to the data template will propagate out to all of its data sources.</p>
<div class="SECT2">
<h2 class="SECT2"><a name="CREATING_DATA_TEMPLATES" id="CREATING_DATA_TEMPLATES">Creating a Data Template</a></h2>
<p>To create a new data template, select <span class="GUILABEL">Data Templates</span> under the <span class="GUILABEL">Templates</span> heading and click <span class="GUILABEL">Add</span>.</p>
<p>The first thing you must do is give the template a name. This name has nothing to do with the data source name, but is what you will use to identify the template throughout Cacti. Second, you will notice a list of data source/data source item field names with Use <span class="GUILABEL">Per-Data Source Value</span> checkboxes next to each one. The nice thing about templates in Cacti is that you can choose whether to template each field on a per-field basis. If you leave the checkbox unchecked, every data source attached to the template will inherit its value from the template. If the checkbox is checked, every data source attached to the template will contain its own value for that particular field.</p>
<div class="TABLE">
<a name="AEN1234" id="AEN1234"></a>
<p><b>Table 11-4. Field Description: Data Templates</b></p>
<table border="1" frame="border" rules="all" class="CALSTABLE">
<col width="1*">
<col width="3*">
<thead>
<tr>
<th align="center">Name</th>
<th align="center">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Name</td>
<td>
<p>This is the name that cacti uses to identify this data source. You must type something here, but you may include spaces and other non-alphanumeric characters.</p>
<p><b class="EMPHASIS">Note:</b> You can use the keyword |host_description| in this field, which will be automatically substituted with the current host description.</p>
</td>
</tr>
<tr>
<td>Data Source Path</td>
<td>The full path to the RRD file associated with this data source. When creating a new data source you will typically leave this field blank as Cacti will generate one for you. If you are using an RRD file generated outside of Cacti, you need to specify it here.</td>
</tr>
<tr>
<td>Data Input Method</td>
<td>Here is where you tell cacti how it is supposed to fetch data for this data source. There are several data input sources that come with cacti, and you can add your own by going to Data Input Methods. If this RRD file is being populated outside of cacti, make sure to leave this field set to "None".</td>
</tr>
<tr>
<td>Associated RRAs</td>
<td>You need to associate the data source with at least one RRA so <span class="APPLICATION">RRDTool</span> knows how often and for how long to keep its data. You will almost always want to select all of these values however so you can render daily, weekly, monthly, and yearly graphs.</td>
</tr>
<tr>
<td>Step</td>
<td>This tells <span class="APPLICATION">RRDTool</span> how many seconds there will be between updates. The default is 300 seconds (5 minutes), and is sufficient for most installations.</td>
</tr>
<tr>
<td>Data Source Active</td>
<td>This is a quick and easy to tell Cacti to stop gathering data for this data source. The data source can still be used on graphs, but no data will be fed to it until it is made active again.</td>
</tr>
</tbody>
</table>
</div>
<p><b class="EMPHASIS">Note:</b> For most data templates, you will want to check the <span class="GUILABEL">Use Per-Graph Value</span> checkbox for the name field so each data source using this template has its own unique name. It also makes sense to enter an inital value in this field that includes the variable |host_description| for organizational purposes.</p>
<p>When you are finished filling in values for the data template, click <span class="GUILABEL">Create</span> and you will be presented with a screen similar to the data source edit screen.</p>
<div class="FIGURE">
<a name="IMG_DATA_TEMPLATE_NEW" id="IMG_DATA_TEMPLATE_NEW"></a>
<p><b>Figure 11-2. Adding a Data Template</b></p>
<div class="MEDIAOBJECT">
<p><img src="images/data_template.png"></p>
</div>
</div>
<div class="SECT3">
<h3 class="SECT3"><a name="DATA_TEMPLATE_ITEMS" id="DATA_TEMPLATE_ITEMS">Data Source Items</a></h3>
<p>Like a graph, a data source can have more than one items. This is useful in situations where a script returns more than piece of data at one time. This also applies to data queries, so you can have a single data template that contains both inbound and outbound traffic, rather than having to create a separate data template for each.</p>
<div class="TABLE">
<a name="AEN1280" id="AEN1280"></a>
<p><b>Table 11-5. Field Description: Data Source Items</b></p>
<table border="1" frame="border" rules="all" class="CALSTABLE">
<col width="1*">
<col width="3*">
<thead>
<tr>
<th align="center">Name</th>
<th align="center">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Internal Data Source Name</td>
<td>This is the name used by <span class="APPLICATION">RRDTool</span> to identify this particular data source within the RRD file. <span class="APPLICATION">RRDTool</span> places a limit of 19 alphanumeric characters (plus '_' and '-') on this field.</td>
</tr>
<tr>
<td>Minimum Value</td>
<td>Here is where you specify the minimum value that is expected for this data source in the RRD file. If a value lower than the minimum is given, it will be stored as Unknown (U).</td>
</tr>
<tr>
<td>Maximum Value</td>
<td>Here is where you specify the maximum value that is expected for this data source in the RRD file. If a value higher than the maximum is given, it will be stored as Unknown (U).</td>
</tr>
<tr>
<td>Data Source Type</td>
<td>There are four types of data that <span class="APPLICATION">RRDTool</span> can represent for any given data source: COUNTER, GAUGE, ABSOLUTE, and DERIVE. A gauge is for numbers that are not continuously incrementing. A counter is for continuously incrementing values that might overflow, while a derive does not overflow. The absolute type is used for counters that are reset upon reading.</td>
</tr>
<tr>
<td>Heartbeat</td>
<td>As defined by <span class="APPLICATION">RRDTool</span>: <span class="QUOTE">"The maximum amount of time that can pass before data is entered as "unknown". This field is usually '600' or 2 data gathering intervals"</span>.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="SECT3">
<h3 class="SECT3"><a name="CUSTOM_DATA" id="CUSTOM_DATA">Custom Data</a></h3>
<p>Assuming you selected a data input source on the previous screen, you should now be presented with a <span class="GUILABEL">Custom Data</span> box. Each custom data field is per-field templatable as all of the other data source fields are. Even if you select the <span class="GUILABEL">Use Per-Data Source Value</span> checkbox, it might be useful to specify a value that will be used as an "inital value" for any data source using this data template.</p>
</div>
</div>
<div class="SECT2">
<h2 class="SECT2"><a name="APPLYING_DATA_TEMPLATES" id="APPLYING_DATA_TEMPLATES">Applying Data Templates to Data Sources</a></h2>
<p>Applying a data template to a data source is a very simple process. The first thing you must do is select the data source you want to apply the template to under <span class="GUILABEL">Data Sources</span>. Under the <span class="GUILABEL">Data Template Selection</span> box, select the data template that you want to apply to the data source and click <span class="GUILABEL">Save</span>.</p>
<p>Once the template is applied to the data source, you will notice that you can only change values for the fields that you checked Use <span class="GUILABEL">Per-Data Source Value</span> for.</p>
<p><b class="EMPHASIS">Now any time a change is made to the data template, it will be automatically propagated to the data sources attached to it.</b></p>
</div>
</div>
<div class="NAVFOOTER">
<hr align="left" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="templates.html" accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="host_templates.html" accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">Templates</td>
<td width="34%" align="center" valign="top"><a href="templates.html" accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Host Templates</td>
</tr>
</table>
</div>
</body>
</html>
|