Code

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