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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1st November 2003), see www.w3.org">
<title>Variables</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.76b+">
<link rel="HOME" title="The Cacti Manual" href="index.html">
<link rel="UP" title="Reference" href="reference.html">
<link rel="PREVIOUS" title="Reference" href="reference.html">
<link rel="NEXT" title="Host Variables" href="host_variables.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="reference.html" accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom"></td>
<td width="10%" align="right" valign="bottom"><a href="host_variables.html" accesskey="N">Next</a></td>
</tr>
</table>
<hr align="left" width="100%">
</div>
<div class="CHAPTER">
<h1><a name="VARIABLES"></a>Chapter 15. Variables</h1>
<div class="TOC">
<dl>
<dt><b>Table of Contents</b></dt>
<dt><a href="variables.html#GRAPH_VARIABLES">Graph Variables</a></dt>
<dt><a href="host_variables.html">Host Variables</a></dt>
</dl>
</div>
<div class="SECT1">
<h1 class="SECT1"><a name="GRAPH_VARIABLES"></a>Graph Variables</h1>
<p>The following variables can be used in the <span class="GUILABEL">Text Format</span> and <span class="GUILABEL">Value</span> graph item fields. Below is a description of each of these variables.</p>
<div class="SECT2">
<h2 class="SECT2"><a name="VARIABLE_DATE_TIME"></a>Date/Time</h2>
<pre class="SCREEN">
<tt class="USERINPUT"><b>|date_time|</b></tt>
</pre>
<p>This variable will place the date and time of the last poller run on the graph. It can be used to replicate <span class="APPLICATION">MRTG</span>'s "graph last updated" feature.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><a name="VARIABLE_DATA_QUERY"></a>Data Query Fields</h2>
<pre class="SCREEN">
<tt class="USERINPUT"><b>|query_field_name|</b></tt>
</pre>
<p>You can place the value of any data query field on the by including this variable. Make sure to substitute "field_name" with the actual data query field name.</p>
<div class="EXAMPLE">
<a name="AEN1900"></a>
<p><b>Example 15-1. Print the IP Address on a traffic graph</b></p>
<p><tt class="USERINPUT"><b>|query_ifIP|</b></tt></p>
</div>
<div class="EXAMPLE">
<a name="AEN1904"></a>
<p><b>Example 15-2. Print the mount point on net-snmp disk graph</b></p>
<p><tt class="USERINPUT"><b>|query_dskPath|</b></tt></p>
</div>
</div>
<div class="SECT2">
<h2 class="SECT2"><a name="VARIABLE_95TH_PERCENTILE"></a>95th Percentile</h2>
<pre class="SCREEN">
<tt class="USERINPUT"><b>|95:(bits|bytes):[0-9]:(current|total|max):[0-9]|</b></tt>
</pre>
<p>95th percentile is often used by hosting providers to bill customers based on their peak traffic usage while ignoring their top 5 percent. This way if a customer has a fairly consistent traffic pattern and decides to download a huge file one day, the large spike will be ignored.</p>
<p>In Cacti, 95th percentile works just like any other graph variable. To use this variable you must give it four arguments:</p>
<div class="TABLE">
<a name="AEN1914"></a>
<p><b>Table 15-1. 95th Percentile Argument Description</b></p>
<table border="1" class="CALSTABLE">
<thead>
<tr>
<th width="25%" align="center" valign="top">Name</th>
<th width="75%" align="center" valign="top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td width="25%" align="left" valign="top"><tt class="FUNCTION">(bits|bytes)</tt></td>
<td width="75%" align="left" valign="top">Choose whether you want to represent your 95th percentile in bits or bytes. The only valid values for this field are 'bits' and 'bytes'.</td>
</tr>
<tr>
<td width="25%" align="left" valign="top"><tt class="FUNCTION">[0-9]</tt></td>
<td width="75%" align="left" valign="top">This field determines the power of 10 divisor that will be applied to your 95th percentile number. Enter '0' to leave the number alone, '3' for kilo or '6' for mega, etc.</td>
</tr>
<tr>
<td width="25%" align="left" valign="top"><tt class="FUNCTION">(current|total|max)</tt></td>
<td width="75%" align="left" valign="top">You can choose to calculate the 95th percentile based on the current data source or a total of all data sources used on the graph. The only valid values for this field are 'current' and 'total'.</td>
</tr>
<tr>
<td width="25%" align="left" valign="top"><tt class="FUNCTION">[0-9]</tt></td>
<td width="75%" align="left" valign="top">Enter the number of digits to use for floating point precision when printing out the final number. The default value for this field is two decimal places.</td>
</tr>
</tbody>
</table>
</div>
<div class="EXAMPLE">
<a name="AEN1940"></a>
<p><b>Example 15-3. Output in the following format: 42.58 mbit</b></p>
<p><tt class="USERINPUT"><b>|95:bits:6:max:2|</b></tt></p>
</div>
</div>
<div class="SECT2">
<h2 class="SECT2"><a name="VARIABLE_BANDWIDTH_SUMMATION"></a>Bandwidth Summation</h2>
<pre class="SCREEN">
<tt class="USERINPUT"><b>|sum:([0-9]|auto):(current|total):([0-9]):([0-9]+|auto)|</b></tt>
</pre>
<p>Bandwidth summation is useful for summing up all values in an RRD file for a given time range. This is typically useful on traffic graphs where you can see a total of all traffic that has gone through an interface in a given time period.</p>
<p>In Cacti, bandwidth summation works just like any other graph variable. To use this variable you must give it three arguments:</p>
<div class="TABLE">
<a name="AEN1950"></a>
<p><b>Table 15-2. Bandwidth Summation Argument Description</b></p>
<table border="1" class="CALSTABLE">
<thead>
<tr>
<th width="25%" align="center" valign="top">Name</th>
<th width="75%" align="center" valign="top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td width="25%" align="left" valign="top"><tt class="FUNCTION">([0-9]|auto)</tt></td>
<td width="75%" align="left" valign="top">This field determines the power of 10 divisor that will be applied to your number. Enter '0' to leave the number alone, '3' for kilo or '6' for mega, etc. You can also enter 'auto' for this field to have Cacti automatically scale the number and insert the appropriate label.</td>
</tr>
<tr>
<td width="25%" align="left" valign="top"><tt class="FUNCTION">(current|total)</tt></td>
<td width="75%" align="left" valign="top">You can choose to calculate the summation based on the current data source or a total of all data sources used on the graph. The only valid values for this field are 'current' and 'total'.</td>
</tr>
<tr>
<td width="25%" align="left" valign="top"><tt class="FUNCTION">[0-9]</tt></td>
<td width="75%" align="left" valign="top">Enter the number of digits to use for floating point precision when printing out the final number. The default value for this field is two decimal places.</td>
</tr>
<tr>
<td width="25%" align="left" valign="top"><tt class="FUNCTION">([0-9]+|auto)</tt></td>
<td width="75%" align="left" valign="top">Enter the number of seconds in the past to perform the summation calculation for. For instance '86400' for 24 hours, '172800' for 48 hours, etc. You can also enter 'auto' for this field to have Cacti use the graph timespan.</td>
</tr>
</tbody>
</table>
</div>
<div class="EXAMPLE">
<a name="AEN1976"></a>
<p><b>Example 15-4. Output in the following format: 36.47 GB</b></p>
<p><tt class="USERINPUT"><b>|sum:auto:current:2:auto|</b></tt></p>
</div>
</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="reference.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_variables.html" accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">Reference</td>
<td width="34%" align="center" valign="top"><a href="reference.html" accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Host Variables</td>
</tr>
</table>
</div>
</body>
</html>
|