Code

Imported upstream SVN snapshot 1.4~rc2+20090928.
[pkg-rrdtool.git] / doc / rrdcreate.1
1 .\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.08)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 'br\}
42 .\"
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
44 .ie \n(.g .ds Aq \(aq
45 .el       .ds Aq '
46 .\"
47 .\" If the F register is turned on, we'll generate index entries on stderr for
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49 .\" entries marked with X<> in POD.  Of course, you'll have to process the
50 .\" output yourself in some meaningful fashion.
51 .ie \nF \{\
52 .    de IX
53 .    tm Index:\\$1\t\\n%\t"\\$2"
54 ..
55 .    nr % 0
56 .    rr F
57 .\}
58 .el \{\
59 .    de IX
60 ..
61 .\}
62 .\"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
65 .    \" fudge factors for nroff and troff
66 .if n \{\
67 .    ds #H 0
68 .    ds #V .8m
69 .    ds #F .3m
70 .    ds #[ \f1
71 .    ds #] \fP
72 .\}
73 .if t \{\
74 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75 .    ds #V .6m
76 .    ds #F 0
77 .    ds #[ \&
78 .    ds #] \&
79 .\}
80 .    \" simple accents for nroff and troff
81 .if n \{\
82 .    ds ' \&
83 .    ds ` \&
84 .    ds ^ \&
85 .    ds , \&
86 .    ds ~ ~
87 .    ds /
88 .\}
89 .if t \{\
90 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96 .\}
97 .    \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 .    \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 .    \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
112 \{\
113 .    ds : e
114 .    ds 8 ss
115 .    ds o a
116 .    ds d- d\h'-1'\(ga
117 .    ds D- D\h'-1'\(hy
118 .    ds th \o'bp'
119 .    ds Th \o'LP'
120 .    ds ae ae
121 .    ds Ae AE
122 .\}
123 .rm #[ #] #H #V #F C
124 .\" ========================================================================
125 .\"
126 .IX Title "RRDCREATE 1"
127 .TH RRDCREATE 1 "2009-04-19" "1.3.999" "rrdtool"
128 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
130 .if n .ad l
131 .nh
132 .SH "NAME"
133 rrdcreate \- Set up a new Round Robin Database
134 .SH "SYNOPSIS"
135 .IX Header "SYNOPSIS"
136 \&\fBrrdtool\fR \fBcreate\fR \fIfilename\fR
137 [\fB\-\-start\fR|\fB\-b\fR\ \fIstart\ time\fR]
138 [\fB\-\-step\fR|\fB\-s\fR\ \fIstep\fR]
139 [\fB\s-1DS:\s0\fR\fIds-name\fR\fB:\fR\fI\s-1DST\s0\fR\fB:\fR\fIdst\ arguments\fR]
140 [\fB\s-1RRA:\s0\fR\fI\s-1CF\s0\fR\fB:\fR\fIcf\ arguments\fR]
141 .SH "DESCRIPTION"
142 .IX Header "DESCRIPTION"
143 The create function of RRDtool lets you set up new Round Robin
144 Database (\fB\s-1RRD\s0\fR) files.  The file is created at its final, full size
145 and filled with \fI*UNKNOWN*\fR data.
146 .SS "\fIfilename\fP"
147 .IX Subsection "filename"
148 The name of the \fB\s-1RRD\s0\fR you want to create. \fB\s-1RRD\s0\fR files should end
149 with the extension \fI.rrd\fR. However, \fBRRDtool\fR will accept any
150 filename.
151 .SS "\fB\-\-start\fP|\fB\-b\fP \fIstart time\fP (default: now \- 10s)"
152 .IX Subsection "--start|-b start time (default: now - 10s)"
153 Specifies the time in seconds since 1970\-01\-01 \s-1UTC\s0 when the first
154 value should be added to the \fB\s-1RRD\s0\fR. \fBRRDtool\fR will not accept
155 any data timed before or at the time specified.
156 .PP
157 See also AT-STYLE \s-1TIME\s0 \s-1SPECIFICATION\s0 section in the
158 \&\fIrrdfetch\fR documentation for other ways to specify time.
159 .SS "\fB\-\-step\fP|\fB\-s\fP \fIstep\fP (default: 300 seconds)"
160 .IX Subsection "--step|-s step (default: 300 seconds)"
161 Specifies the base interval in seconds with which data will be fed
162 into the \fB\s-1RRD\s0\fR.
163 .SS "\fB\s-1DS:\s0\fP\fIds-name\fP\fB:\fP\fI\s-1DST\s0\fP\fB:\fP\fIdst arguments\fP"
164 .IX Subsection "DS:ds-name:DST:dst arguments"
165 A single \fB\s-1RRD\s0\fR can accept input from several data sources (\fB\s-1DS\s0\fR),
166 for example incoming and outgoing traffic on a specific communication
167 line. With the \fB\s-1DS\s0\fR configuration option you must define some basic
168 properties of each data source you want to store in the \fB\s-1RRD\s0\fR.
169 .PP
170 \&\fIds-name\fR is the name you will use to reference this particular data
171 source from an \fB\s-1RRD\s0\fR. A \fIds-name\fR must be 1 to 19 characters long in
172 the characters [a\-zA\-Z0\-9_].
173 .PP
174 \&\fI\s-1DST\s0\fR defines the Data Source Type. The remaining arguments of a
175 data source entry depend on the data source type. For \s-1GAUGE\s0, \s-1COUNTER\s0,
176 \&\s-1DERIVE\s0, and \s-1ABSOLUTE\s0 the format for a data source entry is:
177 .PP
178 \&\fB\s-1DS:\s0\fR\fIds-name\fR\fB:\fR\fI\s-1GAUGE\s0 | \s-1COUNTER\s0 | \s-1DERIVE\s0 | \s-1ABSOLUTE\s0\fR\fB:\fR\fIheartbeat\fR\fB:\fR\fImin\fR\fB:\fR\fImax\fR
179 .PP
180 For \s-1COMPUTE\s0 data sources, the format is:
181 .PP
182 \&\fB\s-1DS:\s0\fR\fIds-name\fR\fB:\fR\fI\s-1COMPUTE\s0\fR\fB:\fR\fIrpn-expression\fR
183 .PP
184 In order to decide which data source type to use, review the
185 definitions that follow. Also consult the section on \*(L"\s-1HOW\s0 \s-1TO\s0 \s-1MEASURE\s0\*(R"
186 for further insight.
187 .IP "\fB\s-1GAUGE\s0\fR" 4
188 .IX Item "GAUGE"
189 is for things like temperatures or number of people in a room or the
190 value of a RedHat share.
191 .IP "\fB\s-1COUNTER\s0\fR" 4
192 .IX Item "COUNTER"
193 is for continuous incrementing counters like the ifInOctets counter in
194 a router. The \fB\s-1COUNTER\s0\fR data source assumes that the counter never
195 decreases, except when a counter overflows.  The update function takes
196 the overflow into account.  The counter is stored as a per-second
197 rate. When the counter overflows, RRDtool checks if the overflow
198 happened at the 32bit or 64bit border and acts accordingly by adding
199 an appropriate value to the result.
200 .IP "\fB\s-1DERIVE\s0\fR" 4
201 .IX Item "DERIVE"
202 will store the derivative of the line going from the last to the
203 current value of the data source. This can be useful for gauges, for
204 example, to measure the rate of people entering or leaving a
205 room. Internally, derive works exactly like \s-1COUNTER\s0 but without
206 overflow checks. So if your counter does not reset at 32 or 64 bit you
207 might want to use \s-1DERIVE\s0 and combine it with a \s-1MIN\s0 value of 0.
208 .Sp
209 \&\fB\s-1NOTE\s0 on \s-1COUNTER\s0 vs \s-1DERIVE\s0\fR
210 .Sp
211 by Don Baarda <don.baarda@baesystems.com>
212 .Sp
213 If you cannot tolerate ever mistaking the occasional counter reset for a
214 legitimate counter wrap, and would prefer \*(L"Unknowns\*(R" for all legitimate
215 counter wraps and resets, always use \s-1DERIVE\s0 with min=0. Otherwise, using
216 \&\s-1COUNTER\s0 with a suitable max will return correct values for all legitimate
217 counter wraps, mark some counter resets as \*(L"Unknown\*(R", but can mistake some
218 counter resets for a legitimate counter wrap.
219 .Sp
220 For a 5 minute step and 32\-bit counter, the probability of mistaking a
221 counter reset for a legitimate wrap is arguably about 0.8% per 1Mbps of
222 maximum bandwidth. Note that this equates to 80% for 100Mbps interfaces, so
223 for high bandwidth interfaces and a 32bit counter, \s-1DERIVE\s0 with min=0 is
224 probably preferable. If you are using a 64bit counter, just about any max
225 setting will eliminate the possibility of mistaking a reset for a counter
226 wrap.
227 .IP "\fB\s-1ABSOLUTE\s0\fR" 4
228 .IX Item "ABSOLUTE"
229 is for counters which get reset upon reading. This is used for fast counters
230 which tend to overflow. So instead of reading them normally you reset them
231 after every read to make sure you have a maximum time available before the
232 next overflow. Another usage is for things you count like number of messages
233 since the last update.
234 .IP "\fB\s-1COMPUTE\s0\fR" 4
235 .IX Item "COMPUTE"
236 is for storing the result of a formula applied to other data sources
237 in the \fB\s-1RRD\s0\fR. This data source is not supplied a value on update, but
238 rather its Primary Data Points (PDPs) are computed from the PDPs of
239 the data sources according to the rpn-expression that defines the
240 formula. Consolidation functions are then applied normally to the PDPs
241 of the \s-1COMPUTE\s0 data source (that is the rpn-expression is only applied
242 to generate PDPs). In database software, such data sets are referred
243 to as \*(L"virtual\*(R" or \*(L"computed\*(R" columns.
244 .PP
245 \&\fIheartbeat\fR defines the maximum number of seconds that may pass
246 between two updates of this data source before the value of the
247 data source is assumed to be \fI*UNKNOWN*\fR.
248 .PP
249 \&\fImin\fR and \fImax\fR define the expected range values for data supplied by a
250 data source. If \fImin\fR and/or \fImax\fR any value outside the defined range
251 will be regarded as \fI*UNKNOWN*\fR. If you do not know or care about min and
252 max, set them to U for unknown. Note that min and max always refer to the
253 processed values of the \s-1DS\s0. For a traffic\-\fB\s-1COUNTER\s0\fR type \s-1DS\s0 this would be
254 the maximum and minimum data-rate expected from the device.
255 .PP
256 \&\fIIf information on minimal/maximal expected values is available,
257 always set the min and/or max properties. This will help RRDtool in
258 doing a simple sanity check on the data supplied when running update.\fR
259 .PP
260 \&\fIrpn-expression\fR defines the formula used to compute the PDPs of a
261 \&\s-1COMPUTE\s0 data source from other data sources in the same <\s-1RRD\s0>. It is
262 similar to defining a \fB\s-1CDEF\s0\fR argument for the graph command. Please
263 refer to that manual page for a list and description of \s-1RPN\s0 operations
264 supported. For \s-1COMPUTE\s0 data sources, the following \s-1RPN\s0 operations are
265 not supported: \s-1COUNT\s0, \s-1PREV\s0, \s-1TIME\s0, and \s-1LTIME\s0. In addition, in defining
266 the \s-1RPN\s0 expression, the \s-1COMPUTE\s0 data source may only refer to the
267 names of data source listed previously in the create command. This is
268 similar to the restriction that \fB\s-1CDEF\s0\fRs must refer only to \fB\s-1DEF\s0\fRs
269 and \fB\s-1CDEF\s0\fRs previously defined in the same graph command.
270 .SS "\fB\s-1RRA:\s0\fP\fI\s-1CF\s0\fP\fB:\fP\fIcf arguments\fP"
271 .IX Subsection "RRA:CF:cf arguments"
272 The purpose of an \fB\s-1RRD\s0\fR is to store data in the round robin archives
273 (\fB\s-1RRA\s0\fR). An archive consists of a number of data values or statistics for
274 each of the defined data-sources (\fB\s-1DS\s0\fR) and is defined with an \fB\s-1RRA\s0\fR line.
275 .PP
276 When data is entered into an \fB\s-1RRD\s0\fR, it is first fit into time slots
277 of the length defined with the \fB\-s\fR option, thus becoming a \fIprimary
278 data point\fR.
279 .PP
280 The data is also processed with the consolidation function (\fI\s-1CF\s0\fR) of
281 the archive. There are several consolidation functions that
282 consolidate primary data points via an aggregate function: \fB\s-1AVERAGE\s0\fR,
283 \&\fB\s-1MIN\s0\fR, \fB\s-1MAX\s0\fR, \fB\s-1LAST\s0\fR.
284 .IP "\s-1AVERAGE\s0" 4
285 .IX Item "AVERAGE"
286 the average of the data points is stored.
287 .IP "\s-1MIN\s0" 4
288 .IX Item "MIN"
289 the smallest of the data points is stored.
290 .IP "\s-1MAX\s0" 4
291 .IX Item "MAX"
292 the largest of the data points is stored.
293 .IP "\s-1LAST\s0" 4
294 .IX Item "LAST"
295 the last data points is used.
296 .PP
297 Note that data aggregation inevitably leads to loss of precision and
298 information. The trick is to pick the aggregate function such that the
299 \&\fIinteresting\fR properties of your data is kept across the aggregation
300 process.
301 .PP
302 The format of \fB\s-1RRA\s0\fR line for these
303 consolidation functions is:
304 .PP
305 \&\fB\s-1RRA:\s0\fR\fI\s-1AVERAGE\s0 | \s-1MIN\s0 | \s-1MAX\s0 | \s-1LAST\s0\fR\fB:\fR\fIxff\fR\fB:\fR\fIsteps\fR\fB:\fR\fIrows\fR
306 .PP
307 \&\fIxff\fR The xfiles factor defines what part of a consolidation interval may
308 be made up from \fI*UNKNOWN*\fR data while the consolidated value is still
309 regarded as known. It is given as the ratio of allowed \fI*UNKNOWN*\fR PDPs
310 to the number of PDPs in the interval. Thus, it ranges from 0 to 1 (exclusive).
311 .PP
312 \&\fIsteps\fR defines how many of these \fIprimary data points\fR are used to build
313 a \fIconsolidated data point\fR which then goes into the archive.
314 .PP
315 \&\fIrows\fR defines how many generations of data values are kept in an \fB\s-1RRA\s0\fR.
316 Obviously, this has to be greater than zero.
317 .SH "Aberrant Behavior Detection with Holt-Winters Forecasting"
318 .IX Header "Aberrant Behavior Detection with Holt-Winters Forecasting"
319 In addition to the aggregate functions, there are a set of specialized
320 functions that enable \fBRRDtool\fR to provide data smoothing (via the
321 Holt-Winters forecasting algorithm), confidence bands, and the
322 flagging aberrant behavior in the data source time series:
323 .IP "\(bu" 4
324 \&\fB\s-1RRA:\s0\fR\fI\s-1HWPREDICT\s0\fR\fB:\fR\fIrows\fR\fB:\fR\fIalpha\fR\fB:\fR\fIbeta\fR\fB:\fR\fIseasonal period\fR[\fB:\fR\fIrra-num\fR]
325 .IP "\(bu" 4
326 \&\fB\s-1RRA:\s0\fR\fI\s-1MHWPREDICT\s0\fR\fB:\fR\fIrows\fR\fB:\fR\fIalpha\fR\fB:\fR\fIbeta\fR\fB:\fR\fIseasonal period\fR[\fB:\fR\fIrra-num\fR]
327 .IP "\(bu" 4
328 \&\fB\s-1RRA:\s0\fR\fI\s-1SEASONAL\s0\fR\fB:\fR\fIseasonal period\fR\fB:\fR\fIgamma\fR\fB:\fR\fIrra-num\fR[\fB:smoothing\-window=\fR\fIfraction\fR]
329 .IP "\(bu" 4
330 \&\fB\s-1RRA:\s0\fR\fI\s-1DEVSEASONAL\s0\fR\fB:\fR\fIseasonal period\fR\fB:\fR\fIgamma\fR\fB:\fR\fIrra-num\fR[\fB:smoothing\-window=\fR\fIfraction\fR]
331 .IP "\(bu" 4
332 \&\fB\s-1RRA:\s0\fR\fI\s-1DEVPREDICT\s0\fR\fB:\fR\fIrows\fR\fB:\fR\fIrra-num\fR
333 .IP "\(bu" 4
334 \&\fB\s-1RRA:\s0\fR\fI\s-1FAILURES\s0\fR\fB:\fR\fIrows\fR\fB:\fR\fIthreshold\fR\fB:\fR\fIwindow length\fR\fB:\fR\fIrra-num\fR
335 .PP
336 These \fBRRAs\fR differ from the true consolidation functions in several ways.
337 First, each of the \fB\s-1RRA\s0\fRs is updated once for every primary data point.
338 Second, these \fBRRAs\fR are interdependent. To generate real-time confidence
339 bounds, a matched set of \s-1SEASONAL\s0, \s-1DEVSEASONAL\s0, \s-1DEVPREDICT\s0, and either
340 \&\s-1HWPREDICT\s0 or \s-1MHWPREDICT\s0 must exist. Generating smoothed values of the primary
341 data points requires a \s-1SEASONAL\s0 \fB\s-1RRA\s0\fR and either an \s-1HWPREDICT\s0 or \s-1MHWPREDICT\s0 
342 \&\fB\s-1RRA\s0\fR. Aberrant behavior detection requires \s-1FAILURES\s0, \s-1DEVSEASONAL\s0, \s-1SEASONAL\s0,
343 and either \s-1HWPREDICT\s0 or \s-1MHWPREDICT\s0.
344 .PP
345 The predicted, or smoothed, values are stored in the \s-1HWPREDICT\s0 or \s-1MHWPREDICT\s0
346 \&\fB\s-1RRA\s0\fR. \s-1HWPREDICT\s0 and \s-1MHWPREDICT\s0 are actually two variations on the
347 Holt-Winters method. They are interchangeable. Both attempt to decompose data
348 into three components: a baseline, a trend, and a seasonal coefficient.
349 \&\s-1HWPREDICT\s0 adds its seasonal coefficient to the baseline to form a prediction, whereas
350 \&\s-1MHWPREDICT\s0 multiplies its seasonal coefficient by the baseline to form a
351 prediction. The difference is noticeable when the baseline changes
352 significantly in the course of a season; \s-1HWPREDICT\s0 will predict the seasonality
353 to stay constant as the baseline changes, but \s-1MHWPREDICT\s0 will predict the
354 seasonality to grow or shrink in proportion to the baseline. The proper choice
355 of method depends on the thing being modeled. For simplicity, the rest of this
356 discussion will refer to \s-1HWPREDICT\s0, but \s-1MHWPREDICT\s0 may be substituted in its
357 place.
358 .PP
359 The predicted deviations are stored in \s-1DEVPREDICT\s0 (think a standard deviation
360 which can be scaled to yield a confidence band). The \s-1FAILURES\s0 \fB\s-1RRA\s0\fR stores 
361 binary indicators. A 1 marks the indexed observation as failure; that is, the 
362 number of confidence bounds violations in the preceding window of observations 
363 met or exceeded a specified threshold. An example of using these \fBRRAs\fR to graph 
364 confidence bounds and failures appears in rrdgraph.
365 .PP
366 The \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 \fBRRAs\fR store the seasonal coefficients for the
367 Holt-Winters forecasting algorithm and the seasonal deviations, respectively.
368 There is one entry per observation time point in the seasonal cycle. For
369 example, if primary data points are generated every five minutes and the
370 seasonal cycle is 1 day, both \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 will have 288 rows.
371 .PP
372 In order to simplify the creation for the novice user, in addition to
373 supporting explicit creation of the \s-1HWPREDICT\s0, \s-1SEASONAL\s0, \s-1DEVPREDICT\s0,
374 \&\s-1DEVSEASONAL\s0, and \s-1FAILURES\s0 \fBRRAs\fR, the \fBRRDtool\fR create command supports
375 implicit creation of the other four when \s-1HWPREDICT\s0 is specified alone and
376 the final argument \fIrra-num\fR is omitted.
377 .PP
378 \&\fIrows\fR specifies the length of the \fB\s-1RRA\s0\fR prior to wrap around. Remember
379 that there is a one-to-one correspondence between primary data points and
380 entries in these RRAs. For the \s-1HWPREDICT\s0 \s-1CF\s0, \fIrows\fR should be larger than
381 the \fIseasonal period\fR. If the \s-1DEVPREDICT\s0 \fB\s-1RRA\s0\fR is implicitly created, the
382 default number of rows is the same as the \s-1HWPREDICT\s0 \fIrows\fR argument. If the
383 \&\s-1FAILURES\s0 \fB\s-1RRA\s0\fR is implicitly created, \fIrows\fR will be set to the \fIseasonal
384 period\fR argument of the \s-1HWPREDICT\s0 \fB\s-1RRA\s0\fR. Of course, the \fBRRDtool\fR
385 \&\fIresize\fR command is available if these defaults are not sufficient and the
386 creator wishes to avoid explicit creations of the other specialized function
387 \&\fBRRAs\fR.
388 .PP
389 \&\fIseasonal period\fR specifies the number of primary data points in a seasonal
390 cycle. If \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 are implicitly created, this argument for
391 those \fBRRAs\fR is set automatically to the value specified by \s-1HWPREDICT\s0. If
392 they are explicitly created, the creator should verify that all three
393 \&\fIseasonal period\fR arguments agree.
394 .PP
395 \&\fIalpha\fR is the adaption parameter of the intercept (or baseline)
396 coefficient in the Holt-Winters forecasting algorithm. See rrdtool for a
397 description of this algorithm. \fIalpha\fR must lie between 0 and 1. A value
398 closer to 1 means that more recent observations carry greater weight in
399 predicting the baseline component of the forecast. A value closer to 0 means
400 that past history carries greater weight in predicting the baseline
401 component.
402 .PP
403 \&\fIbeta\fR is the adaption parameter of the slope (or linear trend) coefficient
404 in the Holt-Winters forecasting algorithm. \fIbeta\fR must lie between 0 and 1
405 and plays the same role as \fIalpha\fR with respect to the predicted linear
406 trend.
407 .PP
408 \&\fIgamma\fR is the adaption parameter of the seasonal coefficients in the
409 Holt-Winters forecasting algorithm (\s-1HWPREDICT\s0) or the adaption parameter in
410 the exponential smoothing update of the seasonal deviations. It must lie
411 between 0 and 1. If the \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 \fBRRAs\fR are created
412 implicitly, they will both have the same value for \fIgamma\fR: the value
413 specified for the \s-1HWPREDICT\s0 \fIalpha\fR argument. Note that because there is
414 one seasonal coefficient (or deviation) for each time point during the
415 seasonal cycle, the adaptation rate is much slower than the baseline. Each
416 seasonal coefficient is only updated (or adapts) when the observed value
417 occurs at the offset in the seasonal cycle corresponding to that
418 coefficient.
419 .PP
420 If \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 \fBRRAs\fR are created explicitly, \fIgamma\fR need not
421 be the same for both. Note that \fIgamma\fR can also be changed via the
422 \&\fBRRDtool\fR \fItune\fR command.
423 .PP
424 \&\fIsmoothing-window\fR specifies the fraction of a season that should be
425 averaged around each point. By default, the value of \fIsmoothing-window\fR is
426 0.05, which means each value in \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 will be occasionally
427 replaced by averaging it with its (\fIseasonal period\fR*0.05) nearest neighbors.
428 Setting \fIsmoothing-window\fR to zero will disable the running-average smoother
429 altogether.
430 .PP
431 \&\fIrra-num\fR provides the links between related \fBRRAs\fR. If \s-1HWPREDICT\s0 is
432 specified alone and the other \fBRRAs\fR are created implicitly, then
433 there is no need to worry about this argument. If \fBRRAs\fR are created
434 explicitly, then carefully pay attention to this argument. For each
435 \&\fB\s-1RRA\s0\fR which includes this argument, there is a dependency between
436 that \fB\s-1RRA\s0\fR and another \fB\s-1RRA\s0\fR. The \fIrra-num\fR argument is the 1\-based
437 index in the order of \fB\s-1RRA\s0\fR creation (that is, the order they appear
438 in the \fIcreate\fR command). The dependent \fB\s-1RRA\s0\fR for each \fB\s-1RRA\s0\fR
439 requiring the \fIrra-num\fR argument is listed here:
440 .IP "\(bu" 4
441 \&\s-1HWPREDICT\s0 \fIrra-num\fR is the index of the \s-1SEASONAL\s0 \fB\s-1RRA\s0\fR.
442 .IP "\(bu" 4
443 \&\s-1SEASONAL\s0 \fIrra-num\fR is the index of the \s-1HWPREDICT\s0 \fB\s-1RRA\s0\fR.
444 .IP "\(bu" 4
445 \&\s-1DEVPREDICT\s0 \fIrra-num\fR is the index of the \s-1DEVSEASONAL\s0 \fB\s-1RRA\s0\fR.
446 .IP "\(bu" 4
447 \&\s-1DEVSEASONAL\s0 \fIrra-num\fR is the index of the \s-1HWPREDICT\s0 \fB\s-1RRA\s0\fR.
448 .IP "\(bu" 4
449 \&\s-1FAILURES\s0 \fIrra-num\fR is the index of the \s-1DEVSEASONAL\s0 \fB\s-1RRA\s0\fR.
450 .PP
451 \&\fIthreshold\fR is the minimum number of violations (observed values outside
452 the confidence bounds) within a window that constitutes a failure. If the
453 \&\s-1FAILURES\s0 \fB\s-1RRA\s0\fR is implicitly created, the default value is 7.
454 .PP
455 \&\fIwindow length\fR is the number of time points in the window. Specify an
456 integer greater than or equal to the threshold and less than or equal to 28.
457 The time interval this window represents depends on the interval between
458 primary data points. If the \s-1FAILURES\s0 \fB\s-1RRA\s0\fR is implicitly created, the
459 default value is 9.
460 .SH "The HEARTBEAT and the STEP"
461 .IX Header "The HEARTBEAT and the STEP"
462 Here is an explanation by Don Baarda on the inner workings of RRDtool.
463 It may help you to sort out why all this *UNKNOWN* data is popping
464 up in your databases:
465 .PP
466 RRDtool gets fed samples/updates at arbitrary times. From these it builds Primary
467 Data Points (PDPs) on every \*(L"step\*(R" interval. The PDPs are
468 then accumulated into the RRAs.
469 .PP
470 The \*(L"heartbeat\*(R" defines the maximum acceptable interval between
471 samples/updates. If the interval between samples is less than \*(L"heartbeat\*(R",
472 then an average rate is calculated and applied for that interval. If
473 the interval between samples is longer than \*(L"heartbeat\*(R", then that
474 entire interval is considered \*(L"unknown\*(R". Note that there are other
475 things that can make a sample interval \*(L"unknown\*(R", such as the rate
476 exceeding limits, or a sample that was explicitly marked as unknown.
477 .PP
478 The known rates during a \s-1PDP\s0's \*(L"step\*(R" interval are used to calculate
479 an average rate for that \s-1PDP\s0. If the total \*(L"unknown\*(R" time accounts for
480 more than \fBhalf\fR the \*(L"step\*(R", the entire \s-1PDP\s0 is marked
481 as \*(L"unknown\*(R". This means that a mixture of known and \*(L"unknown\*(R" sample
482 times in a single \s-1PDP\s0 \*(L"step\*(R" may or may not add up to enough \*(L"known\*(R"
483 time to warrent for a known \s-1PDP\s0.
484 .PP
485 The \*(L"heartbeat\*(R" can be short (unusual) or long (typical) relative to
486 the \*(L"step\*(R" interval between PDPs. A short \*(L"heartbeat\*(R" means you
487 require multiple samples per \s-1PDP\s0, and if you don't get them mark the
488 \&\s-1PDP\s0 unknown. A long heartbeat can span multiple \*(L"steps\*(R", which means
489 it is acceptable to have multiple PDPs calculated from a single
490 sample. An extreme example of this might be a \*(L"step\*(R" of 5 minutes and a
491 \&\*(L"heartbeat\*(R" of one day, in which case a single sample every day will
492 result in all the PDPs for that entire day period being set to the
493 same average rate. \fI\-\- Don Baarda <don.baarda@baesystems.com>\fR
494 .PP
495 .Vb 10
496 \&       time|
497 \&       axis|
498 \& begin_\|_|00|
499 \&        |01|
500 \&       u|02|\-\-\-\-* sample1, restart "hb"\-timer
501 \&       u|03|   /
502 \&       u|04|  /
503 \&       u|05| /
504 \&       u|06|/     "hbt" expired
505 \&       u|07|
506 \&        |08|\-\-\-\-* sample2, restart "hb" 
507 \&        |09|   / 
508 \&        |10|  /
509 \&       u|11|\-\-\-\-* sample3, restart "hb"
510 \&       u|12|   /
511 \&       u|13|  /
512 \& step1_u|14| /
513 \&       u|15|/     "swt" expired
514 \&       u|16|
515 \&        |17|\-\-\-\-* sample4, restart "hb", create "pdp" for step1 = 
516 \&        |18|   /  = unknown due to 10 "u" labled secs > 0.5 * step
517 \&        |19|  /
518 \&        |20| /
519 \&        |21|\-\-\-\-* sample5, restart "hb"
520 \&        |22|   /
521 \&        |23|  /
522 \&        |24|\-\-\-\-* sample6, restart "hb"
523 \&        |25|   /
524 \&        |26|  /
525 \&        |27|\-\-\-\-* sample7, restart "hb"
526 \& step2_\|_|28|   /
527 \&        |22|  /
528 \&        |23|\-\-\-\-* sample8, restart "hb", create "pdp" for step1, create "cdp" 
529 \&        |24|   /
530 \&        |25|  /
531 .Ve
532 .PP
533 graphics by \fIvladimir.lavrov@desy.de\fR.
534 .SH "HOW TO MEASURE"
535 .IX Header "HOW TO MEASURE"
536 Here are a few hints on how to measure:
537 .IP "Temperature" 4
538 .IX Item "Temperature"
539 Usually you have some type of meter you can read to get the temperature.
540 The temperature is not really connected with a time. The only connection is
541 that the temperature reading happened at a certain time. You can use the
542 \&\fB\s-1GAUGE\s0\fR data source type for this. RRDtool will then record your reading
543 together with the time.
544 .IP "Mail Messages" 4
545 .IX Item "Mail Messages"
546 Assume you have a method to count the number of messages transported by
547 your mailserver in a certain amount of time, giving you data like '5
548 messages in the last 65 seconds'. If you look at the count of 5 like an
549 \&\fB\s-1ABSOLUTE\s0\fR data type you can simply update the \s-1RRD\s0 with the number 5 and the
550 end time of your monitoring period. RRDtool will then record the number of
551 messages per second. If at some later stage you want to know the number of
552 messages transported in a day, you can get the average messages per second
553 from RRDtool for the day in question and multiply this number with the
554 number of seconds in a day. Because all math is run with Doubles, the
555 precision should be acceptable.
556 .IP "It's always a Rate" 4
557 .IX Item "It's always a Rate"
558 RRDtool stores rates in amount/second for \s-1COUNTER\s0, \s-1DERIVE\s0 and \s-1ABSOLUTE\s0
559 data.  When you plot the data, you will get on the y axis
560 amount/second which you might be tempted to convert to an absolute
561 amount by multiplying by the delta-time between the points. RRDtool
562 plots continuous data, and as such is not appropriate for plotting
563 absolute amounts as for example \*(L"total bytes\*(R" sent and received in a
564 router. What you probably want is plot rates that you can scale to
565 bytes/hour, for example, or plot absolute amounts with another tool
566 that draws bar-plots, where the delta-time is clear on the plot for
567 each point (such that when you read the graph you see for example \s-1GB\s0
568 on the y axis, days on the x axis and one bar for each day).
569 .SH "EXAMPLE"
570 .IX Header "EXAMPLE"
571 .Vb 6
572 \& rrdtool create temperature.rrd \-\-step 300 \e
573 \&  DS:temp:GAUGE:600:\-273:5000 \e
574 \&  RRA:AVERAGE:0.5:1:1200 \e
575 \&  RRA:MIN:0.5:12:2400 \e
576 \&  RRA:MAX:0.5:12:2400 \e
577 \&  RRA:AVERAGE:0.5:12:2400
578 .Ve
579 .PP
580 This sets up an \fB\s-1RRD\s0\fR called \fItemperature.rrd\fR which accepts one
581 temperature value every 300 seconds. If no new data is supplied for
582 more than 600 seconds, the temperature becomes \fI*UNKNOWN*\fR.  The
583 minimum acceptable value is \-273 and the maximum is 5'000.
584 .PP
585 A few archive areas are also defined. The first stores the
586 temperatures supplied for 100 hours (1'200 * 300 seconds = 100
587 hours). The second \s-1RRA\s0 stores the minimum temperature recorded over
588 every hour (12 * 300 seconds = 1 hour), for 100 days (2'400 hours). The
589 third and the fourth \s-1RRA\s0's do the same for the maximum and
590 average temperature, respectively.
591 .SH "EXAMPLE 2"
592 .IX Header "EXAMPLE 2"
593 .Vb 4
594 \& rrdtool create monitor.rrd \-\-step 300        \e
595 \&   DS:ifOutOctets:COUNTER:1800:0:4294967295   \e
596 \&   RRA:AVERAGE:0.5:1:2016                     \e
597 \&   RRA:HWPREDICT:1440:0.1:0.0035:288
598 .Ve
599 .PP
600 This example is a monitor of a router interface. The first \fB\s-1RRA\s0\fR tracks the
601 traffic flow in octets; the second \fB\s-1RRA\s0\fR generates the specialized
602 functions \fBRRAs\fR for aberrant behavior detection. Note that the \fIrra-num\fR
603 argument of \s-1HWPREDICT\s0 is missing, so the other \fBRRAs\fR will implicitly be
604 created with default parameter values. In this example, the forecasting
605 algorithm baseline adapts quickly; in fact the most recent one hour of
606 observations (each at 5 minute intervals) accounts for 75% of the baseline
607 prediction. The linear trend forecast adapts much more slowly. Observations
608 made during the last day (at 288 observations per day) account for only
609 65% of the predicted linear trend. Note: these computations rely on an
610 exponential smoothing formula described in the \s-1LISA\s0 2000 paper.
611 .PP
612 The seasonal cycle is one day (288 data points at 300 second intervals), and
613 the seasonal adaption parameter will be set to 0.1. The \s-1RRD\s0 file will store 5
614 days (1'440 data points) of forecasts and deviation predictions before wrap
615 around. The file will store 1 day (a seasonal cycle) of 0\-1 indicators in
616 the \s-1FAILURES\s0 \fB\s-1RRA\s0\fR.
617 .PP
618 The same \s-1RRD\s0 file and \fBRRAs\fR are created with the following command,
619 which explicitly creates all specialized function \fBRRAs\fR.
620 .PP
621 .Vb 8
622 \& rrdtool create monitor.rrd \-\-step 300 \e
623 \&   DS:ifOutOctets:COUNTER:1800:0:4294967295 \e
624 \&   RRA:AVERAGE:0.5:1:2016 \e
625 \&   RRA:HWPREDICT:1440:0.1:0.0035:288:3 \e
626 \&   RRA:SEASONAL:288:0.1:2 \e
627 \&   RRA:DEVPREDICT:1440:5 \e
628 \&   RRA:DEVSEASONAL:288:0.1:2 \e
629 \&   RRA:FAILURES:288:7:9:5
630 .Ve
631 .PP
632 Of course, explicit creation need not replicate implicit create, a
633 number of arguments could be changed.
634 .SH "EXAMPLE 3"
635 .IX Header "EXAMPLE 3"
636 .Vb 5
637 \& rrdtool create proxy.rrd \-\-step 300 \e
638 \&   DS:Total:DERIVE:1800:0:U  \e
639 \&   DS:Duration:DERIVE:1800:0:U  \e
640 \&   DS:AvgReqDur:COMPUTE:Duration,Requests,0,EQ,1,Requests,IF,/ \e
641 \&   RRA:AVERAGE:0.5:1:2016
642 .Ve
643 .PP
644 This example is monitoring the average request duration during each 300 sec
645 interval for requests processed by a web proxy during the interval.
646 In this case, the proxy exposes two counters, the number of requests
647 processed since boot and the total cumulative duration of all processed
648 requests. Clearly these counters both have some rollover point, but using the
649 \&\s-1DERIVE\s0 data source also handles the reset that occurs when the web proxy is
650 stopped and restarted.
651 .PP
652 In the \fB\s-1RRD\s0\fR, the first data source stores the requests per second rate
653 during the interval. The second data source stores the total duration of all
654 requests processed during the interval divided by 300. The \s-1COMPUTE\s0 data source
655 divides each \s-1PDP\s0 of the AccumDuration by the corresponding \s-1PDP\s0 of
656 TotalRequests and stores the average request duration. The remainder of the
657 \&\s-1RPN\s0 expression handles the divide by zero case.
658 .SH "AUTHOR"
659 .IX Header "AUTHOR"
660 Tobias Oetiker <tobi@oetiker.ch>