File: templates.html

package info (click to toggle)
cacti 0.8.6i-3
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 4,744 kB
  • ctags: 8,967
  • sloc: php: 39,760; sql: 2,306; xml: 678; sh: 487; perl: 133; makefile: 68
file content (370 lines) | stat: -rw-r--r-- 17,785 bytes parent folder | download | duplicates (2)
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
<!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>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="Advanced Topics" href="advanced_topics.html">
  <link rel="PREVIOUS" title="Script Query XML Syntax" href="script_query_xml.html">
  <link rel="NEXT" title="Data Templates" href="data_templates.html">
  <link rel="STYLESHEET" type="text/css" href="manual.css">
</head>

<body class="CHAPTER" 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="script_query_xml.html" accesskey="P">Prev</a></td>

        <td width="80%" align="center" valign="bottom"></td>

        <td width="10%" align="right" valign="bottom"><a href="data_templates.html" accesskey="N">Next</a></td>
      </tr>
    </table>
    <hr align="left" width="100%">
  </div>

  <div class="CHAPTER">
    <h1><a name="TEMPLATES" id="TEMPLATES"></a>Chapter 11. Templates</h1>

    <div class="TOC">
      <dl>
        <dt><b>Table of Contents</b></dt>

        <dt><a href="templates.html#GRAPH_TEMPLATES">Graph Templates</a></dt>

        <dt><a href="data_templates.html">Data Templates</a></dt>

        <dt><a href="host_templates.html">Host Templates</a></dt>
      </dl>
    </div>

    <div class="SECT1">
      <h1 class="SECT1"><a name="GRAPH_TEMPLATES" id="GRAPH_TEMPLATES">Graph Templates</a></h1>

      <p>In Cacti, a graph template provides a skeleton for an actual graph. If you have many graphs that share most of their characteristics, using a graph template would probably make sense. After a graph is attached to a particular graph template, all changes made to the graph template will propagate out to all of its graphs.</p>

      <div class="SECT2">
        <h2 class="SECT2"><a name="CREATING_GRAPH_TEMPLATES" id="CREATING_GRAPH_TEMPLATES">Creating a Graph Template</a></h2>

        <p>To create a new graph template, select <span class="GUILABEL">Graph 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 graph title, but is what you will use to identify the template throughout Cacti. Second, you will notice a list of graph field names with Use Per-Graph Value 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 uncheked, every graph attached to the template will inherit its value from the template. If the checkbox is checked, every graph attached to the template will contain its own value for that particular field.</p>

        <div class="TABLE">
          <a name="AEN1065" id="AEN1065"></a>

          <p><b>Table 11-1. Field Description: Graph 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>Title</td>

                <td>
                  <p>The title of the graph within Cacti and the title that will be printed on the actual graph itself.</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>Image Format</td>

                <td>Choose whether you would prefer to output your graph images in PNG or GIF. According to the <a href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/manual/rrdgraph.html" target="_top">RRDTool graph manual</a> PNG is preferred because it is both smaller and faster.</td>
              </tr>

              <tr>
                <td>Height</td>

                <td>The height of the graph area in pixels</td>
              </tr>

              <tr>
                <td>Width</td>

                <td>The width of the graph area in pixels</td>
              </tr>

              <tr>
                <td>Auto Scale</td>

                <td>Enable auto scale for the graph. This option must be check to use the next two options. Upper/Lower limit values are ignored when using autoscale since these boundaries are determined automatically.</td>
              </tr>

              <tr>
                <td>Auto Scale Options</td>

                <td>Choose whether you would like to use --alt-autoscale or --alt-autoscale-max on the graph. The <a href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/manual/rrdgraph.html" target="_top">RRDTool graph manual</a> says: <span class="QUOTE">"Where --alt-autoscale will modify both the absolute maximum AND minimum values, this option will only affect the maximum value. The minimum value, if not defined on the command line, will be 0. This option can be useful when graphing router traffic when the WAN line uses compression, and thus the throughput may be higher than the WAN line speed"</span>.</td>
              </tr>

              <tr>
                <td>Logarithmic Auto Scaling</td>

                <td>Choose if you want logarithmic y-axis scaling.</td>
              </tr>

              <tr>
                <td>Rigid Boundaries Mode</td>

                <td>From the RRDTool manual <span class="QUOTE">"Normally rrdgraph will automatically expand the lower and upper limit if the graph contains a value outside the valid range. With this option you can disable this behavior"</span>.</td>
              </tr>

              <tr>
                <td>Auto Padding</td>

                <td>If you have ever created RRDTool-based graphs manually, you may have realized how annoying it can be to get text to line up properly. With this option Cacti will do its best to make the columns on your graph legend line up. This option works best when your graph legend has a consistent number of columns.</td>
              </tr>

              <tr>
                <td>Allow Graph Export</td>

                <td>If you choose to use Cacti's static HTML/image export, you can choose whether you want each individual graph to be exported.</td>
              </tr>

              <tr>
                <td>Upper Limit</td>

                <td>The maximum value that will be displayed on the y-axis. This value is ignored is auto-scaling is turned on.</td>
              </tr>

              <tr>
                <td>Lower Limit</td>

                <td>The minimum value that will be displayed on the y-axis. This value is ignored is auto-scaling is turned on.</td>
              </tr>

              <tr>
                <td>Base Value</td>

                <td>Whether you want to base the y-axis labels on 1000 or 1024. This field will typically be set to 1024 for memory and 1000 for traffic measurements.</td>
              </tr>

              <tr>
                <td>Unit Value</td>

                <td>Sets the unit value for the y-axis. You should probably keep the unit short as to keep it readable.</td>
              </tr>

              <tr>
                <td>Unit Exponent Value</td>

                <td>Sets the 10^e scaling of the y-axis. Valid values for this field are between -18 and 18. For example, you could use 3 to display everything in 'k' (kilo) or -6 to display everything in 'u' (micro).</td>
              </tr>

              <tr>
                <td>Vertical Label</td>

                <td>The text to print on the left edge of the graph. Usually is the units the data on the graph is measured in.</td>
              </tr>
            </tbody>
          </table>
        </div>

        <p><b class="EMPHASIS">Note:</b> For most graph templates, you will want to check the Use <span class="GUILABEL">Per-Graph Value</span> checkbox for the title field so each graph using this template has its own unique title. It also makes sense to enter an initial value in this field that includes the variable |host_description| for organizational purposes.</p>

        <p>When you are finished filling in values for the graph template, click <span class="GUILABEL">Create</span> and you will be presented with a page similar to the graph edit page.</p>

        <div class="FIGURE">
          <a name="IMG_GRAPH_TEMPLATE_NEW" id="IMG_GRAPH_TEMPLATE_NEW"></a>

          <p><b>Figure 11-1. Adding a Graph Template</b></p>

          <div class="MEDIAOBJECT">
            <p><img src="images/graph_template.png"></p>
          </div>
        </div>

        <div class="SECT3">
          <h3 class="SECT3"><a name="GRAPH_ITEMS" id="GRAPH_ITEMS">Graph Items</a></h3>

          <p>The first thing you should do is create graph items for this graph template, just like for a regular graph. One difference you will notice is that the <span class="GUILABEL">Data Sources</span> dropdown will contain a list of data template items rather than data source items. It is important that Cacti can make this association here, so that Cacti doesn't have to make unnecessary assumptions later.</p>

          <div class="TABLE">
            <a name="AEN1144" id="AEN1144"></a>

            <p><b>Table 11-2. Field Description: Graph Template 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>Data Source</td>

                  <td>If this graph item is to represent some sort of data, you must select a your data source here. Keep in mind that not all graph items have a data source. Graph item types such as COMMENT, VRULE, and HRULE typically do not.</td>
                </tr>

                <tr>
                  <td>Color</td>

                  <td>Depending on the graph item type, you can select a color for the graph item. This field only applies to the graph item types AREA, STACK, LINE1, LINE2, and LINE3.</td>
                </tr>

                <tr>
                  <td>Graph Item Type</td>

                  <td>
                    <p>This field is important because it defines what kind of graph item this is. Types such as AREA, STACK, LINE1, LINE2, and LINE3 are used to represent data on the graph, while COMMENT and GPRINT are used put on the legend. The LEGEND type is specific to Cacti only and can be used if you want to Cacti to automatically create a GPRINT-LAST/GPRINT-AVERAGE/GPRINT-MAXIMUM graph item for you.</p>

                    <p><b class="EMPHASIS">Note:</b>: You must always put an AREA item before using STACK or your graph will not render.</p>
                  </td>
                </tr>

                <tr>
                  <td>Consolidation Function</td>

                  <td>This tells <span class="APPLICATION">RRDTool</span> which consolidation function to use when representing this data on the graph. You will typically use AVERAGE for most things on the graph area, and LAST/MAXIMUM as well for GPRINT items.</td>
                </tr>

                <tr>
                  <td>CDEF Function</td>

                  <td>If you want to apply a CDEF function to the graph item, select one here. Check out the CDEF section of the manual for more information.</td>
                </tr>

                <tr>
                  <td>Value</td>

                  <td>This field is only used with the HRULE/VRULE graph item types. Type any valid integer to draw the line at for HRULE or the time of the day HH:MM for VRULE.</td>
                </tr>

                <tr>
                  <td>GPRINT Type</td>

                  <td>If this item is a GPRINT, you can choose how you want the number to be formatted. You can add your own in the GPRINT Presets section of Cacti.</td>
                </tr>

                <tr>
                  <td>Text Format</td>

                  <td>You can enter text to be displayed on the legend here. This field is applicable for all graph item types except for the virtual LEGEND type.</td>
                </tr>

                <tr>
                  <td>Hard Return</td>

                  <td>Check this box to force graph items onto the next line.</td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>

        <div class="SECT3">
          <h3 class="SECT3"><a name="GRAPH_ITEM_INPUTS" id="GRAPH_ITEM_INPUTS">Graph Item Inputs</a></h3>

          <p>After creating graph items for your template, you will need to create some graph item inputs. Graph item inputs are unique to graph templates because of the large number of items they sometimes contain. Graph item inputs enable you to take one graph item field, and associate it with multiple graph items.</p>

          <p>To create a new graph item input, click <span class="GUILABEL">Add</span> on the right of the <span class="GUILABEL">Graph Item Inputs</span> box. There are various fields that must be filled in for every graph item input:</p>

          <div class="TABLE">
            <a name="AEN1191" id="AEN1191"></a>

            <p><b>Table 11-3. Field Description: Graph Template 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>Name</td>

                  <td>This will be the name used to identify the graph item input on both the graph template and graph edit pages.</td>
                </tr>

                <tr>
                  <td>Description</td>

                  <td>(Optional) This description will be displayed on the graph edit page of any graph using this template if specified.</td>
                </tr>

                <tr>
                  <td>Field Type</td>

                  <td>You must choose the field that you are going to associate with one or more graph items.</td>
                </tr>

                <tr>
                  <td>Associated Graph Items</td>

                  <td>Choose one or more graph items to associate with the field selected for "Field Type". When the user specifies a value for the field, it will be applied to all of the items you select here.</td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>

      <div class="SECT2">
        <h2 class="SECT2"><a name="APPLYING_GRAPH_TEMPLATES" id="APPLYING_GRAPH_TEMPLATES">Applying Graph Templates to Graphs</a></h2>

        <p>Applying a graph template to a graph is a very simple process. The first thing you must do is select the graph you want to apply the template to under <span class="GUILABEL">Graph Management</span>. Under the <span class="GUILABEL">Graph Template Selection</span> box, select the graph template that you want to apply to the graph and click <span class="GUILABEL">Save</span>. If this is a new graph or the graph and graph template contains an equal number of graph items, the graph template will be automatically applied. If number of graph items varies from the graph to the target graph template, you will be propmted with a warning that your graph will be changed.</p>

        <p>Once the template is applied to the graph, you will notice that you can only change values for the fields that you checked Use Per-Graph Value for. You will also notice a new box, called <span class="GUILABEL">Graph Item Inputs</span>. This is where you can specify values for the graph items inputs that you defined in the graph template. The values specified here will be applied to each graph item tied to the graph item input.</p>

        <p><b class="EMPHASIS">Now any time a change is made to the graph template, it will be automatically propagated to the graphs attached to it.</b></p>
      </div>
    </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="script_query_xml.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="data_templates.html" accesskey="N">Next</a></td>
      </tr>

      <tr>
        <td width="33%" align="left" valign="top">Script Query XML Syntax</td>

        <td width="34%" align="center" valign="top"><a href="advanced_topics.html" accesskey="U">Up</a></td>

        <td width="33%" align="right" valign="top">Data Templates</td>
      </tr>
    </table>
  </div>
</body>
</html>