Code

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