Code

Imported upstream version 1.4.8
[pkg-rrdtool.git] / doc / rrdtool.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 "RRDTOOL 1"
127 .TH RRDTOOL 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 rrdtool \- Round Robin Database Tool
134 .SH "SYNOPSIS"
135 .IX Header "SYNOPSIS"
136 \&\fBrrdtool\fR \fB\-\fR [workdir]| \fIfunction\fR
137 .SH "DESCRIPTION"
138 .IX Header "DESCRIPTION"
139 .SS "\s-1OVERVIEW\s0"
140 .IX Subsection "OVERVIEW"
141 It is pretty easy to gather status information from all sorts of
142 things, ranging from the temperature in your office to the number of
143 octets which have passed through the \s-1FDDI\s0 interface of your
144 router. But it is not so trivial to store this data in an efficient and
145 systematic manner. This is where \fBRRDtool\fR comes in handy. It lets you
146 \&\fIlog and analyze\fR the data you gather from all kinds of data-sources
147 (\fB\s-1DS\s0\fR). The data analysis part of RRDtool is based on the ability to
148 quickly generate graphical representations of the data values
149 collected over a definable time period.
150 .PP
151 In this man page you will find general information on the design and
152 functionality of the Round Robin Database Tool (RRDtool). For a more
153 detailed description of how to use the individual functions of
154 \&\fBRRDtool\fR check the corresponding man page.
155 .PP
156 For an introduction to the usage of RRDtool make sure you consult the
157 rrdtutorial.
158 .SS "\s-1FUNCTIONS\s0"
159 .IX Subsection "FUNCTIONS"
160 While the man pages talk of command line switches you have to set in
161 order to make \fBRRDtool\fR work it is important to note that
162 \&\fBRRDtool\fR can be remotely controlled through a set of pipes. This
163 saves a considerable amount of startup time when you plan to make
164 \&\fBRRDtool\fR do a lot of things quickly. Check the section on Remote_Control
165 further down. There is also a number of language bindings
166 for RRDtool which allow you to use it directly from Perl, python, Tcl,
167 \&\s-1PHP\s0, etc.
168 .IP "\fBcreate\fR" 8
169 .IX Item "create"
170 Set up a new Round Robin Database (\s-1RRD\s0). Check rrdcreate.
171 .IP "\fBupdate\fR" 8
172 .IX Item "update"
173 Store new data values into an \s-1RRD\s0. Check rrdupdate.
174 .IP "\fBupdatev\fR" 8
175 .IX Item "updatev"
176 Operationally equivalent to \fBupdate\fR except for output. Check rrdupdate.
177 .IP "\fBgraph\fR" 8
178 .IX Item "graph"
179 Create a graph from data stored in one or several RRDs. Apart from
180 generating graphs, data can also be extracted to stdout. Check rrdgraph.
181 .IP "\fBdump\fR" 8
182 .IX Item "dump"
183 Dump the contents of an \s-1RRD\s0 in plain \s-1ASCII\s0. In connection with restore
184 you can use this to move an \s-1RRD\s0 from one computer architecture to
185 another.  Check rrddump.
186 .IP "\fBrestore\fR" 8
187 .IX Item "restore"
188 Restore an \s-1RRD\s0 in \s-1XML\s0 format to a binary \s-1RRD\s0. Check rrdrestore
189 .IP "\fBfetch\fR" 8
190 .IX Item "fetch"
191 Get data for a certain time period from a \s-1RRD\s0. The graph function
192 uses fetch to retrieve its data from an \s-1RRD\s0. Check rrdfetch.
193 .IP "\fBtune\fR" 8
194 .IX Item "tune"
195 Alter setup of an \s-1RRD\s0. Check rrdtune.
196 .IP "\fBlast\fR" 8
197 .IX Item "last"
198 Find the last update time of an \s-1RRD\s0. Check rrdlast.
199 .IP "\fBinfo\fR" 8
200 .IX Item "info"
201 Get information about an \s-1RRD\s0. Check rrdinfo.
202 .IP "\fBrrdresize\fR" 8
203 .IX Item "rrdresize"
204 Change the size of individual RRAs. This is dangerous! Check rrdresize.
205 .IP "\fBxport\fR" 8
206 .IX Item "xport"
207 Export data retrieved from one or several RRDs. Check rrdxport.
208 .IP "\fBflushcached\fR" 8
209 .IX Item "flushcached"
210 Flush the values for a specific \s-1RRD\s0 file from memory. Check rrdflushcached.
211 .IP "\fBrrdcgi\fR" 8
212 .IX Item "rrdcgi"
213 This is a standalone tool for producing \s-1RRD\s0 graphs on the fly. Check
214 rrdcgi.
215 .SS "\s-1HOW\s0 \s-1DOES\s0 \s-1RRDTOOL\s0 \s-1WORK\s0?"
216 .IX Subsection "HOW DOES RRDTOOL WORK?"
217 .IP "Data Acquisition" 8
218 .IX Item "Data Acquisition"
219 When monitoring the state of a system, it is convenient to have the
220 data available at a constant time interval. Unfortunately, you may not
221 always be able to fetch data at exactly the time you want
222 to. Therefore \fBRRDtool\fR lets you update the log file at any time you
223 want. It will automatically interpolate the value of the data-source
224 (\fB\s-1DS\s0\fR) at the latest official time-slot (interval) and write this
225 interpolated value to the log. The original value you have supplied is
226 stored as well and is also taken into account when interpolating the
227 next log entry.
228 .IP "Consolidation" 8
229 .IX Item "Consolidation"
230 You may log data at a 1 minute interval, but you might also be
231 interested to know the development of the data over the last year. You
232 could do this by simply storing the data in 1 minute intervals for the
233 whole year. While this would take considerable disk space it would
234 also take a lot of time to analyze the data when you wanted to create
235 a graph covering the whole year. \fBRRDtool\fR offers a solution to this
236 problem through its data consolidation feature. When setting up an
237 Round Robin Database (\fB\s-1RRD\s0\fR), you can define at which interval this
238 consolidation should occur, and what consolidation function (\fB\s-1CF\s0\fR)
239 (average, minimum, maximum, total, last) should be used to build the
240 consolidated values (see rrdcreate). You can define any number of
241 different consolidation setups within one \fB\s-1RRD\s0\fR. They will all be
242 maintained on the fly when new data is loaded into the \fB\s-1RRD\s0\fR.
243 .IP "Round Robin Archives" 8
244 .IX Item "Round Robin Archives"
245 Data values of the same consolidation setup are stored into Round
246 Robin Archives (\fB\s-1RRA\s0\fR). This is a very efficient manner to store data
247 for a certain amount of time, while using a known and constant amount
248 of storage space.
249 .Sp
250 It works like this: If you want to store 1'000 values in 5 minute
251 interval, \fBRRDtool\fR will allocate space for 1'000 data values and a
252 header area. In the header it will store a pointer telling which slots
253 (value) in the storage area was last written to. New values are
254 written to the Round Robin Archive in, you guessed it, a round robin
255 manner. This automatically limits the history to the last 1'000 values
256 (in our example). Because you can define several \fB\s-1RRA\s0\fRs within a
257 single \fB\s-1RRD\s0\fR, you can setup another one, for storing 750 data values
258 at a 2 hour interval, for example, and thus keep a log for the last
259 two months at a lower resolution.
260 .Sp
261 The use of \fB\s-1RRA\s0\fRs guarantees that the \fB\s-1RRD\s0\fR does not grow over
262 time and that old data is automatically eliminated. By using the
263 consolidation feature, you can still keep data for a very long time,
264 while gradually reducing the resolution of the data along the time
265 axis.
266 .Sp
267 Using different consolidation functions (\fB\s-1CF\s0\fR) allows you to store
268 exactly the type of information that actually interests you: the maximum
269 one minute traffic on the \s-1LAN\s0, the minimum temperature of your wine cellar,
270 the total minutes of down time, etc.
271 .IP "Unknown Data" 8
272 .IX Item "Unknown Data"
273 As mentioned earlier, the \fB\s-1RRD\s0\fR stores data at a constant
274 interval. Sometimes it may happen that no new data is available when a
275 value has to be written to the \fB\s-1RRD\s0\fR. Data acquisition may not be
276 possible for one reason or other. With \fBRRDtool\fR you can handle these
277 situations by storing an \fI*UNKNOWN*\fR value into the database. The
278 value '\fI*UNKNOWN*\fR' is supported through all the functions of the
279 tool. When consolidating a data set, the amount of \fI*UNKNOWN*\fR data
280 values is accounted for and when a new consolidated value is ready to
281 be written to its Round Robin Archive (\fB\s-1RRA\s0\fR), a validity check is
282 performed to make sure that the percentage of unknown values in the
283 data point is above a configurable level. If not, an \fI*UNKNOWN*\fR value
284 will be written to the \fB\s-1RRA\s0\fR.
285 .IP "Graphing" 8
286 .IX Item "Graphing"
287 \&\fBRRDtool\fR allows you to generate reports in numerical and
288 graphical form based on the data stored in one or several
289 \&\fB\s-1RRD\s0\fRs. The graphing feature is fully configurable. Size, color and
290 contents of the graph can be defined freely. Check rrdgraph
291 for more information on this.
292 .IP "Aberrant Behavior Detection" 8
293 .IX Item "Aberrant Behavior Detection"
294 by Jake Brutlag
295 .Sp
296 \&\fBRRDtool\fR provides the building blocks for near real-time aberrant
297 behavior detection. These components include:
298 .RS 8
299 .IP "\(bu" 4
300 An algorithm for predicting the value of a time series one time step
301 into the future.
302 .IP "\(bu" 4
303 A measure of deviation between predicted and observed values.
304 .IP "\(bu" 4
305 A mechanism to decide if and when an observed value or sequence of
306 observed values is \fItoo deviant\fR from the predicted value(s).
307 .RE
308 .RS 8
309 .Sp
310 Here is a brief explanation of these components:
311 .Sp
312 The Holt-Winters time series forecasting algorithm is an on-line (or
313 incremental) algorithm that adaptively predicts future observations in
314 a time series. Its forecast is the sum of three components: a baseline
315 (or intercept), a linear trend over time (or slope), and a seasonal
316 coefficient (a periodic effect, such as a daily cycle). There is one
317 seasonal coefficient for each time point in the period (cycle). After
318 a value is observed, each of these components is updated via
319 exponential smoothing. This means that the algorithm \*(L"learns\*(R" from
320 past values and uses them to predict the future. The rate of
321 adaptation is governed by 3 parameters, alpha (intercept), beta
322 (slope), and gamma (seasonal). The prediction can also be viewed as a
323 smoothed value for the time series.
324 .Sp
325 The measure of deviation is a seasonal weighted absolute
326 deviation. The term \fIseasonal\fR means deviation is measured separately
327 for each time point in the seasonal cycle. As with Holt-Winters
328 forecasting, deviation is predicted using the measure computed from
329 past values (but only at that point in the seasonal cycle). After the
330 value is observed, the algorithm learns from the observed value via
331 exponential smoothing. Confidence bands for the observed time series
332 are generated by scaling the sequence of predicted deviation values
333 (we usually think of the sequence as a continuous line rather than a
334 set of discrete points).
335 .Sp
336 Aberrant behavior (a potential failure) is reported whenever the
337 number of times the observed value violates the confidence bands meets
338 or exceeds a specified threshold within a specified temporal window
339 (e.g. 5 violations during the past 45 minutes with a value observed
340 every 5 minutes).
341 .Sp
342 This functionality is embedded in a set of related \fBRRAs\fR. In
343 particular, a \s-1FAILURES\s0 \fB\s-1RRA\s0\fR logs potential failures. With these data
344 you could, for example, use a front-end application to \fBRRDtool\fR to
345 initiate real-time alerts.
346 .Sp
347 For a detailed description on how to set this up, see rrdcreate.
348 .RE
349 .SS "\s-1REMOTE\s0 \s-1CONTROL\s0"
350 .IX Subsection "REMOTE CONTROL"
351 When you start \fBRRDtool\fR with the command line option '\fB\-\fR' it waits
352 for input via standard input (\s-1STDIN\s0). With this feature you can
353 improve performance by attaching \fBRRDtool\fR to another process (\s-1MRTG\s0
354 is one example) through a set of pipes. Over these pipes \fBRRDtool\fR
355 accepts the same arguments as on the command line and some special
356 commands like \fBquit, cd, mkdir\fR and \fBls\fR. For detailed help on the
357 server commands type:
358 .PP
359 .Vb 1
360 \&   rrdtool help cd|mkdir|pwd|ls|quit
361 .Ve
362 .PP
363 When a command is completed, RRDtool will print the string  '\f(CW\*(C`OK\*(C'\fR',
364 followed by timing information of the form \fBu:\fR\fIusertime\fR
365 \&\fBs:\fR\fIsystemtime\fR. Both values are the running totals of seconds since
366 RRDtool was started. If an error occurs, a line of the form '\f(CW\*(C`ERROR:\*(C'\fR
367 \&\fIDescription of error\fR' will be printed instead. \fBRRDtool\fR will not abort,
368 unless something really serious happens. If
369 a \fBworkdir\fR is specified and the \s-1UID\s0 is 0, RRDtool will do a chroot to that
370 workdir. If the \s-1UID\s0 is not 0, RRDtool only changes the current directory to
371 \&\fBworkdir\fR.
372 .SS "\s-1RRD\s0 Server"
373 .IX Subsection "RRD Server"
374 If you want to create a RRD-Server, you must choose a \s-1TCP/IP\s0 Service
375 number and add them to \fI/etc/services\fR like this:
376 .PP
377 .Vb 1
378 \& rrdsrv      13900/tcp                       # RRD server
379 .Ve
380 .PP
381 Attention: the \s-1TCP\s0 port 13900 isn't officially registered for
382 rrdsrv. You can use any unused port in your services file, but the
383 server and the client system must use the same port, of course.
384 .PP
385 With this configuration you can add RRDtool as meta-server to
386 \&\fI/etc/inetd.conf\fR. For example:
387 .PP
388 .Vb 1
389 \& rrdsrv stream tcp nowait root /opt/rrd/bin/rrdtool rrdtool \- /var/rrd
390 .Ve
391 .PP
392 Don't forget to create the database directory /var/rrd and
393 reinitialize your inetd.
394 .PP
395 If all was setup correctly, you can access the server with Perl
396 sockets, tools like netcat, or in a quick interactive test by using
397 \&'telnet localhost rrdsrv'.
398 .PP
399 \&\fB\s-1NOTE:\s0\fR that there is no authentication with this feature! Do not setup
400 such a port unless you are sure what you are doing.
401 .SH "RRDCACHED, THE CACHING DAEMON"
402 .IX Header "RRDCACHED, THE CACHING DAEMON"
403 For very big setups, updating thousands of \s-1RRD\s0 files often becomes a serious \s-1IO\s0
404 problem. If you run into such problems, you might want to take a look at
405 rrdcached, a caching daemon for RRDtool which may help you lessen the
406 stress on your disks.
407 .SH "SEE ALSO"
408 .IX Header "SEE ALSO"
409 rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast, rrdxport,
410 rrdflushcached, rrdcached
411 .SH "BUGS"
412 .IX Header "BUGS"
413 Bugs? Features!
414 .SH "AUTHOR"
415 .IX Header "AUTHOR"
416 Tobias Oetiker <tobi@oetiker.ch>