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