Code

Build-conflict on lua50 as the lua binding autofoo stuff is buggy as hell.
[pkg-rrdtool.git] / doc / rrdcreate.html
index 2d44c4917214f75ae143cad667dad42be85c8892..42f0aa4210b5ca9d214f0031913811772cf58365 100644 (file)
@@ -1,9 +1,7 @@
-<?xml version="1.0" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>rrdcreate</title>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
 <link rev="made" href="mailto:root@localhost" />
 </head>
 
        <li><a href="#name">NAME</a></li>
        <li><a href="#synopsis">SYNOPSIS</a></li>
        <li><a href="#description">DESCRIPTION</a></li>
+       <ul>
+
+               <li><a href="#filename"><em>filename</em></a></li>
+               <li><a href="#start_b_start_time__default__now__10s_"><strong>-start</strong>|<strong>-b</strong> <em>start time</em> (default: now - 10s)</a></li>
+               <li><a href="#step_s_step__default__300_seconds_"><strong>-step</strong>|<strong>-s</strong> <em>step</em> (default: 300 seconds)</a></li>
+               <li><a href="#ds_dsname_dst_dst_arguments"><strong>DS:</strong><em>ds-name</em><strong>:</strong><em>DST</em><strong>:</strong><em>dst arguments</em></a></li>
+               <li><a href="#rra_cf_cf_arguments"><strong>RRA:</strong><em>CF</em><strong>:</strong><em>cf arguments</em></a></li>
+       </ul>
+
        <li><a href="#aberrant_behavior_detection_with_holtwinters_forecasting">Aberrant Behavior Detection with Holt-Winters Forecasting</a></li>
        <li><a href="#the_heartbeat_and_the_step">The HEARTBEAT and the STEP</a></li>
        <li><a href="#how_to_measure">HOW TO MEASURE</a></li>
 <p>The create function of RRDtool lets you set up new Round Robin
 Database (<strong>RRD</strong>) files.  The file is created at its final, full size
 and filled with <em>*UNKNOWN*</em> data.</p>
-<dl>
-<dt><strong><a name="item_filename"><em>filename</em></a></strong></dt>
-
-<dd>
+<p>
+</p>
+<h2><a name="filename"><em>filename</em></a></h2>
 <p>The name of the <strong>RRD</strong> you want to create. <strong>RRD</strong> files should end
 with the extension <em>.rrd</em>. However, <strong>RRDtool</strong> will accept any
 filename.</p>
-</dd>
-<dt><strong><a name="item_time"><strong>--start</strong>|<strong>-b</strong> <em>start time</em> (default: now - 10s)</a></strong></dt>
-
-<dd>
+<p>
+</p>
+<h2><a name="start_b_start_time__default__now__10s_"><strong>--start</strong>|<strong>-b</strong> <em>start time</em> (default: now - 10s)</a></h2>
 <p>Specifies the time in seconds since 1970-01-01 UTC when the first
 value should be added to the <strong>RRD</strong>. <strong>RRDtool</strong> will not accept
 any data timed before or at the time specified.</p>
 <p>See also AT-STYLE TIME SPECIFICATION section in the
 <em>rrdfetch</em> documentation for other ways to specify time.</p>
-</dd>
-<dt><strong><a name="item_step"><strong>--step</strong>|<strong>-s</strong> <em>step</em> (default: 300 seconds)</a></strong></dt>
-
-<dd>
+<p>
+</p>
+<h2><a name="step_s_step__default__300_seconds_"><strong>--step</strong>|<strong>-s</strong> <em>step</em> (default: 300 seconds)</a></h2>
 <p>Specifies the base interval in seconds with which data will be fed
 into the <strong>RRD</strong>.</p>
-</dd>
-<dt><strong><a name="item_ds_3ads_2dname_3adst_3adst_arguments"><strong>DS:</strong><em>ds-name</em><strong>:</strong><em>DST</em><strong>:</strong><em>dst arguments</em></a></strong></dt>
-
-<dd>
+<p>
+</p>
+<h2><a name="ds_dsname_dst_dst_arguments"><strong>DS:</strong><em>ds-name</em><strong>:</strong><em>DST</em><strong>:</strong><em>dst arguments</em></a></h2>
 <p>A single <strong>RRD</strong> can accept input from several data sources (<strong>DS</strong>),
 for example incoming and outgoing traffic on a specific communication
 line. With the <strong>DS</strong> configuration option you must define some basic
@@ -92,40 +95,50 @@ DERIVE, and ABSOLUTE the format for a data source entry is:</p>
 definitions that follow. Also consult the section on ``HOW TO MEASURE''
 for further insight.</p>
 <dl>
-<dt><strong><a name="item_gauge"><strong>GAUGE</strong></a></strong></dt>
-
+<dt><strong><a name="item_gauge"><strong>GAUGE</strong></a></strong><br />
+</dt>
 <dd>
-<p>is for things like temperatures or number of people in a room or the
-value of a RedHat share.</p>
+is for things like temperatures or number of people in a room or the
+value of a RedHat share.
 </dd>
-<dt><strong><a name="item_counter"><strong>COUNTER</strong></a></strong></dt>
-
+<p></p>
+<dt><strong><a name="item_counter"><strong>COUNTER</strong></a></strong><br />
+</dt>
 <dd>
-<p>is for continuous incrementing counters like the ifInOctets counter in
+is for continuous incrementing counters like the ifInOctets counter in
 a router. The <strong>COUNTER</strong> data source assumes that the counter never
 decreases, except when a counter overflows.  The update function takes
 the overflow into account.  The counter is stored as a per-second
 rate. When the counter overflows, RRDtool checks if the overflow
 happened at the 32bit or 64bit border and acts accordingly by adding
-an appropriate value to the result.</p>
+an appropriate value to the result.
 </dd>
-<dt><strong><a name="item_derive"><strong>DERIVE</strong></a></strong></dt>
-
+<p></p>
+<dt><strong><a name="item_derive"><strong>DERIVE</strong></a></strong><br />
+</dt>
 <dd>
-<p>will store the derivative of the line going from the last to the
+will store the derivative of the line going from the last to the
 current value of the data source. This can be useful for gauges, for
 example, to measure the rate of people entering or leaving a
 room. Internally, derive works exactly like COUNTER but without
 overflow checks. So if your counter does not reset at 32 or 64 bit you
-might want to use DERIVE and combine it with a MIN value of 0.</p>
-<p>NOTE on COUNTER vs DERIVE</p>
+might want to use DERIVE and combine it with a MIN value of 0.
+</dd>
+<dd>
+<p><strong>NOTE on COUNTER vs DERIVE</strong></p>
+</dd>
+<dd>
 <p>by Don Baarda &lt;<a href="mailto:don.baarda@baesystems.com">don.baarda@baesystems.com</a>&gt;</p>
+</dd>
+<dd>
 <p>If you cannot tolerate ever mistaking the occasional counter reset for a
 legitimate counter wrap, and would prefer ``Unknowns'' for all legitimate
 counter wraps and resets, always use DERIVE with min=0. Otherwise, using
 COUNTER with a suitable max will return correct values for all legitimate
 counter wraps, mark some counter resets as ``Unknown'', but can mistake some
 counter resets for a legitimate counter wrap.</p>
+</dd>
+<dd>
 <p>For a 5 minute step and 32-bit counter, the probability of mistaking a
 counter reset for a legitimate wrap is arguably about 0.8% per 1Mbps of
 maximum bandwidth. Note that this equates to 80% for 100Mbps interfaces, so
@@ -134,28 +147,30 @@ probably preferable. If you are using a 64bit counter, just about any max
 setting will eliminate the possibility of mistaking a reset for a counter
 wrap.</p>
 </dd>
-<dt><strong><a name="item_absolute"><strong>ABSOLUTE</strong></a></strong></dt>
-
+<p></p>
+<dt><strong><a name="item_absolute"><strong>ABSOLUTE</strong></a></strong><br />
+</dt>
 <dd>
-<p>is for counters which get reset upon reading. This is used for fast counters
+is for counters which get reset upon reading. This is used for fast counters
 which tend to overflow. So instead of reading them normally you reset them
 after every read to make sure you have a maximum time available before the
 next overflow. Another usage is for things you count like number of messages
-since the last update.</p>
+since the last update.
 </dd>
-<dt><strong><a name="item_compute"><strong>COMPUTE</strong></a></strong></dt>
-
+<p></p>
+<dt><strong><a name="item_compute"><strong>COMPUTE</strong></a></strong><br />
+</dt>
 <dd>
-<p>is for storing the result of a formula applied to other data sources
+is for storing the result of a formula applied to other data sources
 in the <strong>RRD</strong>. This data source is not supplied a value on update, but
 rather its Primary Data Points (PDPs) are computed from the PDPs of
 the data sources according to the rpn-expression that defines the
 formula. Consolidation functions are then applied normally to the PDPs
 of the COMPUTE data source (that is the rpn-expression is only applied
 to generate PDPs). In database software, such data sets are referred
-to as ``virtual'' or ``computed'' columns.</p>
+to as ``virtual'' or ``computed'' columns.
 </dd>
-</dl>
+<p></p></dl>
 <p><em>heartbeat</em> defines the maximum number of seconds that may pass
 between two updates of this data source before the value of the
 data source is assumed to be <em>*UNKNOWN*</em>.</p>
@@ -178,10 +193,9 @@ the RPN expression, the COMPUTE data source may only refer to the
 names of data source listed previously in the create command. This is
 similar to the restriction that <strong>CDEF</strong>s must refer only to <strong>DEF</strong>s
 and <strong>CDEF</strong>s previously defined in the same graph command.</p>
-</dd>
-<dt><strong><a name="item_rra_3acf_3acf_arguments"><strong>RRA:</strong><em>CF</em><strong>:</strong><em>cf arguments</em></a></strong></dt>
-
-<dd>
+<p>
+</p>
+<h2><a name="rra_cf_cf_arguments"><strong>RRA:</strong><em>CF</em><strong>:</strong><em>cf arguments</em></a></h2>
 <p>The purpose of an <strong>RRD</strong> is to store data in the round robin archives
 (<strong>RRA</strong>). An archive consists of a number of data values or statistics for
 each of the defined data-sources (<strong>DS</strong>) and is defined with an <strong>RRA</strong> line.</p>
@@ -191,7 +205,37 @@ data point</em>.</p>
 <p>The data is also processed with the consolidation function (<em>CF</em>) of
 the archive. There are several consolidation functions that
 consolidate primary data points via an aggregate function: <strong>AVERAGE</strong>,
-<strong>MIN</strong>, <strong>MAX</strong>, <strong>LAST</strong>. The format of <strong>RRA</strong> line for these
+<strong>MIN</strong>, <strong>MAX</strong>, <strong>LAST</strong>.</p>
+<dl>
+<dt><strong><a name="item_average">AVERAGE</a></strong><br />
+</dt>
+<dd>
+the average of the data points is stored.
+</dd>
+<p></p>
+<dt><strong><a name="item_min">MIN</a></strong><br />
+</dt>
+<dd>
+the smallest of the data points is stored.
+</dd>
+<p></p>
+<dt><strong><a name="item_max">MAX</a></strong><br />
+</dt>
+<dd>
+the largest of the data points is stored.
+</dd>
+<p></p>
+<dt><strong><a name="item_last">LAST</a></strong><br />
+</dt>
+<dd>
+the last data points is used.
+</dd>
+<p></p></dl>
+<p>Note that data aggregation inevitably leads to loss of precision and
+information. The trick is to pick the aggregate function such that the
+<em>interesting</em> properties of your data is kept across the aggregation
+process.</p>
+<p>The format of <strong>RRA</strong> line for these
 consolidation functions is:</p>
 <p><strong>RRA:</strong><em>AVERAGE | MIN | MAX | LAST</em><strong>:</strong><em>xff</em><strong>:</strong><em>steps</em><strong>:</strong><em>rows</em></p>
 <p><em>xff</em> The xfiles factor defines what part of a consolidation interval may
@@ -200,9 +244,8 @@ regarded as known. It is given as the ratio of allowed <em>*UNKNOWN*</em> PDPs
 to the number of PDPs in the interval. Thus, it ranges from 0 to 1 (exclusive).</p>
 <p><em>steps</em> defines how many of these <em>primary data points</em> are used to build
 a <em>consolidated data point</em> which then goes into the archive.</p>
-<p><em>rows</em> defines how many generations of data values are kept in an <strong>RRA</strong>.</p>
-</dd>
-</dl>
+<p><em>rows</em> defines how many generations of data values are kept in an <strong>RRA</strong>.
+Obviously, this has to be greater than zero.</p>
 <p>
 </p>
 <hr />
@@ -212,37 +255,51 @@ functions that enable <strong>RRDtool</strong> to provide data smoothing (via th
 Holt-Winters forecasting algorithm), confidence bands, and the
 flagging aberrant behavior in the data source time series:</p>
 <ul>
-<li>
-<p><strong>RRA:</strong><em>HWPREDICT</em><strong>:</strong><em>rows</em><strong>:</strong><em>alpha</em><strong>:</strong><em>beta</em><strong>:</strong><em>seasonal period</em>[<strong>:</strong><em>rra-num</em>]</p>
-</li>
-<li>
-<p><strong>RRA:</strong><em>SEASONAL</em><strong>:</strong><em>seasonal period</em><strong>:</strong><em>gamma</em><strong>:</strong><em>rra-num</em></p>
-</li>
-<li>
-<p><strong>RRA:</strong><em>DEVSEASONAL</em><strong>:</strong><em>seasonal period</em><strong>:</strong><em>gamma</em><strong>:</strong><em>rra-num</em></p>
-</li>
-<li>
-<p><strong>RRA:</strong><em>DEVPREDICT</em><strong>:</strong><em>rows</em><strong>:</strong><em>rra-num</em></p>
-</li>
-<li>
-<p><strong>RRA:</strong><em>FAILURES</em><strong>:</strong><em>rows</em><strong>:</strong><em>threshold</em><strong>:</strong><em>window length</em><strong>:</strong><em>rra-num</em></p>
-</li>
-</ul>
+<li></li>
+<strong>RRA:</strong><em>HWPREDICT</em><strong>:</strong><em>rows</em><strong>:</strong><em>alpha</em><strong>:</strong><em>beta</em><strong>:</strong><em>seasonal period</em>[<strong>:</strong><em>rra-num</em>]
+<p></p>
+<li></li>
+<strong>RRA:</strong><em>MHWPREDICT</em><strong>:</strong><em>rows</em><strong>:</strong><em>alpha</em><strong>:</strong><em>beta</em><strong>:</strong><em>seasonal period</em>[<strong>:</strong><em>rra-num</em>]
+<p></p>
+<li></li>
+<strong>RRA:</strong><em>SEASONAL</em><strong>:</strong><em>seasonal period</em><strong>:</strong><em>gamma</em><strong>:</strong><em>rra-num</em>[<strong>:smoothing-window=</strong><em>fraction</em>]
+<p></p>
+<li></li>
+<strong>RRA:</strong><em>DEVSEASONAL</em><strong>:</strong><em>seasonal period</em><strong>:</strong><em>gamma</em><strong>:</strong><em>rra-num</em>[<strong>:smoothing-window=</strong><em>fraction</em>]
+<p></p>
+<li></li>
+<strong>RRA:</strong><em>DEVPREDICT</em><strong>:</strong><em>rows</em><strong>:</strong><em>rra-num</em>
+<p></p>
+<li></li>
+<strong>RRA:</strong><em>FAILURES</em><strong>:</strong><em>rows</em><strong>:</strong><em>threshold</em><strong>:</strong><em>window length</em><strong>:</strong><em>rra-num</em>
+<p></p></ul>
 <p>These <strong>RRAs</strong> differ from the true consolidation functions in several ways.
 First, each of the <strong>RRA</strong>s is updated once for every primary data point.
 Second, these <strong>RRAs</strong> are interdependent. To generate real-time confidence
-bounds, a matched set of HWPREDICT, SEASONAL, DEVSEASONAL, and
-DEVPREDICT must exist. Generating smoothed values of the primary data points
-requires both a HWPREDICT <strong>RRA</strong> and SEASONAL <strong>RRA</strong>. Aberrant behavior
-detection requires FAILURES, HWPREDICT, DEVSEASONAL, and SEASONAL.</p>
-<p>The actual predicted, or smoothed, values are stored in the HWPREDICT
-<strong>RRA</strong>. The predicted deviations are stored in DEVPREDICT (think a standard
-deviation which can be scaled to yield a confidence band). The FAILURES
-<strong>RRA</strong> stores binary indicators. A 1 marks the indexed observation as
-failure; that is, the number of confidence bounds violations in the
-preceding window of observations met or exceeded a specified threshold. An
-example of using these <strong>RRAs</strong> to graph confidence bounds and failures
-appears in <a href="././rrdgraph.html">the rrdgraph manpage</a>.</p>
+bounds, a matched set of SEASONAL, DEVSEASONAL, DEVPREDICT, and either
+HWPREDICT or MHWPREDICT must exist. Generating smoothed values of the primary
+data points requires a SEASONAL <strong>RRA</strong> and either an HWPREDICT or MHWPREDICT 
+<strong>RRA</strong>. Aberrant behavior detection requires FAILURES, DEVSEASONAL, SEASONAL,
+and either HWPREDICT or MHWPREDICT.</p>
+<p>The predicted, or smoothed, values are stored in the HWPREDICT or MHWPREDICT
+<strong>RRA</strong>. HWPREDICT and MHWPREDICT are actually two variations on the
+Holt-Winters method. They are interchangeable. Both attempt to decompose data
+into three components: a baseline, a trend, and a seasonal coefficient.
+HWPREDICT adds its seasonal coefficient to the baseline to form a prediction, whereas
+MHWPREDICT multiplies its seasonal coefficient by the baseline to form a
+prediction. The difference is noticeable when the baseline changes
+significantly in the course of a season; HWPREDICT will predict the seasonality
+to stay constant as the baseline changes, but MHWPREDICT will predict the
+seasonality to grow or shrink in proportion to the baseline. The proper choice
+of method depends on the thing being modeled. For simplicity, the rest of this
+discussion will refer to HWPREDICT, but MHWPREDICT may be substituted in its
+place.</p>
+<p>The predicted deviations are stored in DEVPREDICT (think a standard deviation
+which can be scaled to yield a confidence band). The FAILURES <strong>RRA</strong> stores 
+binary indicators. A 1 marks the indexed observation as failure; that is, the 
+number of confidence bounds violations in the preceding window of observations 
+met or exceeded a specified threshold. An example of using these <strong>RRAs</strong> to graph 
+confidence bounds and failures appears in <a href="././rrdgraph.html">the rrdgraph manpage</a>.</p>
 <p>The SEASONAL and DEVSEASONAL <strong>RRAs</strong> store the seasonal coefficients for the
 Holt-Winters forecasting algorithm and the seasonal deviations, respectively.
 There is one entry per observation time point in the seasonal cycle. For
@@ -293,6 +350,12 @@ coefficient.</p>
 <p>If SEASONAL and DEVSEASONAL <strong>RRAs</strong> are created explicitly, <em>gamma</em> need not
 be the same for both. Note that <em>gamma</em> can also be changed via the
 <strong>RRDtool</strong> <em>tune</em> command.</p>
+<p><em>smoothing-window</em> specifies the fraction of a season that should be
+averaged around each point. By default, the value of <em>smoothing-window</em> is
+0.05, which means each value in SEASONAL and DEVSEASONAL will be occasionally
+replaced by averaging it with its (<em>seasonal period</em>*0.05) nearest neighbors.
+Setting <em>smoothing-window</em> to zero will disable the running-average smoother
+altogether.</p>
 <p><em>rra-num</em> provides the links between related <strong>RRAs</strong>. If HWPREDICT is
 specified alone and the other <strong>RRAs</strong> are created implicitly, then
 there is no need to worry about this argument. If <strong>RRAs</strong> are created
@@ -303,22 +366,21 @@ index in the order of <strong>RRA</strong> creation (that is, the order they app
 in the <em>create</em> command). The dependent <strong>RRA</strong> for each <strong>RRA</strong>
 requiring the <em>rra-num</em> argument is listed here:</p>
 <ul>
-<li>
-<p>HWPREDICT <em>rra-num</em> is the index of the SEASONAL <strong>RRA</strong>.</p>
-</li>
-<li>
-<p>SEASONAL <em>rra-num</em> is the index of the HWPREDICT <strong>RRA</strong>.</p>
-</li>
-<li>
-<p>DEVPREDICT <em>rra-num</em> is the index of the DEVSEASONAL <strong>RRA</strong>.</p>
-</li>
-<li>
-<p>DEVSEASONAL <em>rra-num</em> is the index of the HWPREDICT <strong>RRA</strong>.</p>
-</li>
-<li>
-<p>FAILURES <em>rra-num</em> is the index of the DEVSEASONAL <strong>RRA</strong>.</p>
-</li>
-</ul>
+<li></li>
+HWPREDICT <em>rra-num</em> is the index of the SEASONAL <strong>RRA</strong>.
+<p></p>
+<li></li>
+SEASONAL <em>rra-num</em> is the index of the HWPREDICT <strong>RRA</strong>.
+<p></p>
+<li></li>
+DEVPREDICT <em>rra-num</em> is the index of the DEVSEASONAL <strong>RRA</strong>.
+<p></p>
+<li></li>
+DEVSEASONAL <em>rra-num</em> is the index of the HWPREDICT <strong>RRA</strong>.
+<p></p>
+<li></li>
+FAILURES <em>rra-num</em> is the index of the DEVSEASONAL <strong>RRA</strong>.
+<p></p></ul>
 <p><em>threshold</em> is the minimum number of violations (observed values outside
 the confidence bounds) within a window that constitutes a failure. If the
 FAILURES <strong>RRA</strong> is implicitly created, the default value is 7.</p>
@@ -402,19 +464,20 @@ same average rate. <em>-- Don Baarda &lt;<a href="mailto:don.baarda@baesystems.c
 <h1><a name="how_to_measure">HOW TO MEASURE</a></h1>
 <p>Here are a few hints on how to measure:</p>
 <dl>
-<dt><strong><a name="item_temperature">Temperature</a></strong></dt>
-
+<dt><strong><a name="item_temperature">Temperature</a></strong><br />
+</dt>
 <dd>
-<p>Usually you have some type of meter you can read to get the temperature.
+Usually you have some type of meter you can read to get the temperature.
 The temperature is not really connected with a time. The only connection is
 that the temperature reading happened at a certain time. You can use the
 <strong>GAUGE</strong> data source type for this. RRDtool will then record your reading
-together with the time.</p>
+together with the time.
 </dd>
-<dt><strong><a name="item_mail_messages">Mail Messages</a></strong></dt>
-
+<p></p>
+<dt><strong><a name="item_mail_messages">Mail Messages</a></strong><br />
+</dt>
 <dd>
-<p>Assume you have a method to count the number of messages transported by
+Assume you have a method to count the number of messages transported by
 your mailserver in a certain amount of time, giving you data like '5
 messages in the last 65 seconds'. If you look at the count of 5 like an
 <strong>ABSOLUTE</strong> data type you can simply update the RRD with the number 5 and the
@@ -423,12 +486,13 @@ messages per second. If at some later stage you want to know the number of
 messages transported in a day, you can get the average messages per second
 from RRDtool for the day in question and multiply this number with the
 number of seconds in a day. Because all math is run with Doubles, the
-precision should be acceptable.</p>
+precision should be acceptable.
 </dd>
-<dt><strong><a name="item_it_27s_always_a_rate">It's always a Rate</a></strong></dt>
-
+<p></p>
+<dt><strong><a name="item_it_27s_always_a_rate">It's always a Rate</a></strong><br />
+</dt>
 <dd>
-<p>RRDtool stores rates in amount/second for COUNTER, DERIVE and ABSOLUTE
+RRDtool stores rates in amount/second for COUNTER, DERIVE and ABSOLUTE
 data.  When you plot the data, you will get on the y axis
 amount/second which you might be tempted to convert to an absolute
 amount by multiplying by the delta-time between the points. RRDtool
@@ -438,9 +502,9 @@ router. What you probably want is plot rates that you can scale to
 bytes/hour, for example, or plot absolute amounts with another tool
 that draws bar-plots, where the delta-time is clear on the plot for
 each point (such that when you read the graph you see for example GB
-on the y axis, days on the x axis and one bar for each day).</p>
+on the y axis, days on the x axis and one bar for each day).
 </dd>
-</dl>
+<p></p></dl>
 <p>
 </p>
 <hr />