Code

Imported upstream version 1.3.8.
[pkg-rrdtool.git] / doc / rrdtool.1
1 .\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05)
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 "2008-12-22" "1.3.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 "\fBrrdcgi\fR" 8
209 .IX Item "rrdcgi"
210 This is a standalone tool for producing \s-1RRD\s0 graphs on the fly. Check
211 rrdcgi.
212 .SS "\s-1HOW\s0 \s-1DOES\s0 \s-1RRDTOOL\s0 \s-1WORK\s0?"
213 .IX Subsection "HOW DOES RRDTOOL WORK?"
214 .IP "Data Acquisition" 8
215 .IX Item "Data Acquisition"
216 When monitoring the state of a system, it is convenient to have the
217 data available at a constant time interval. Unfortunately, you may not
218 always be able to fetch data at exactly the time you want
219 to. Therefore \fBRRDtool\fR lets you update the logfile at any time you
220 want. It will automatically interpolate the value of the data-source
221 (\fB\s-1DS\s0\fR) at the latest official time-slot (interval) and write this
222 interpolated value to the log. The original value you have supplied is
223 stored as well and is also taken into account when interpolating the
224 next log entry.
225 .IP "Consolidation" 8
226 .IX Item "Consolidation"
227 You may log data at a 1 minute interval, but you might also be
228 interested to know the development of the data over the last year. You
229 could do this by simply storing the data in 1 minute intervals for the
230 whole year. While this would take considerable disk space it would
231 also take a lot of time to analyze the data when you wanted to create
232 a graph covering the whole year. \fBRRDtool\fR offers a solution to this
233 problem through its data consolidation feature. When setting up an
234 Round Robin Database (\fB\s-1RRD\s0\fR), you can define at which interval this
235 consolidation should occur, and what consolidation function (\fB\s-1CF\s0\fR)
236 (average, minimum, maximum, total, last) should be used to build the
237 consolidated values (see rrdcreate). You can define any number of
238 different consolidation setups within one \fB\s-1RRD\s0\fR. They will all be
239 maintained on the fly when new data is loaded into the \fB\s-1RRD\s0\fR.
240 .IP "Round Robin Archives" 8
241 .IX Item "Round Robin Archives"
242 Data values of the same consolidation setup are stored into Round
243 Robin Archives (\fB\s-1RRA\s0\fR). This is a very efficient manner to store data
244 for a certain amount of time, while using a known and constant amount
245 of storage space.
246 .Sp
247 It works like this: If you want to store 1'000 values in 5 minute
248 interval, \fBRRDtool\fR will allocate space for 1'000 data values and a
249 header area. In the header it will store a pointer telling which slots
250 (value) in the storage area was last written to. New values are
251 written to the Round Robin Archive in, you guessed it, a round robin
252 manner. This automatically limits the history to the last 1'000 values
253 (in our example). Because you can define several \fB\s-1RRA\s0\fRs within a
254 single \fB\s-1RRD\s0\fR, you can setup another one, for storing 750 data values
255 at a 2 hour interval, for example, and thus keep a log for the last
256 two months at a lower resolution.
257 .Sp
258 The use of \fB\s-1RRA\s0\fRs guarantees that the \fB\s-1RRD\s0\fR does not grow over
259 time and that old data is automatically eliminated. By using the
260 consolidation feature, you can still keep data for a very long time,
261 while gradually reducing the resolution of the data along the time
262 axis.
263 .Sp
264 Using different consolidation functions (\fB\s-1CF\s0\fR) allows you to store
265 exactly the type of information that actually interests you: the maximum
266 one minute traffic on the \s-1LAN\s0, the minimum temperature of your wine cellar,
267 the total minutes of down time, etc.
268 .IP "Unknown Data" 8
269 .IX Item "Unknown Data"
270 As mentioned earlier, the \fB\s-1RRD\s0\fR stores data at a constant
271 interval. Sometimes it may happen that no new data is available when a
272 value has to be written to the \fB\s-1RRD\s0\fR. Data acquisition may not be
273 possible for one reason or other. With \fBRRDtool\fR you can handle these
274 situations by storing an \fI*UNKNOWN*\fR value into the database. The
275 value '\fI*UNKNOWN*\fR' is supported through all the functions of the
276 tool. When consolidating a data set, the amount of \fI*UNKNOWN*\fR data
277 values is accounted for and when a new consolidated value is ready to
278 be written to its Round Robin Archive (\fB\s-1RRA\s0\fR), a validity check is
279 performed to make sure that the percentage of unknown values in the
280 data point is above a configurable level. If not, an \fI*UNKNOWN*\fR value
281 will be written to the \fB\s-1RRA\s0\fR.
282 .IP "Graphing" 8
283 .IX Item "Graphing"
284 \&\fBRRDtool\fR allows you to generate reports in numerical and
285 graphical form based on the data stored in one or several
286 \&\fB\s-1RRD\s0\fRs. The graphing feature is fully configurable. Size, color and
287 contents of the graph can be defined freely. Check rrdgraph
288 for more information on this.
289 .IP "Aberrant Behavior Detection" 8
290 .IX Item "Aberrant Behavior Detection"
291 by Jake Brutlag
292 .Sp
293 \&\fBRRDtool\fR provides the building blocks for near real-time aberrant
294 behavior detection. These components include:
295 .RS 8
296 .IP "\(bu" 4
297 An algorithm for predicting the value of a time series one time step
298 into the future.
299 .IP "\(bu" 4
300 A measure of deviation between predicted and observed values.
301 .IP "\(bu" 4
302 A mechanism to decide if and when an observed value or sequence of
303 observed values is \fItoo deviant\fR from the predicted value(s).
304 .RE
305 .RS 8
306 .Sp
307 Here is a brief explanation of these components:
308 .Sp
309 The Holt-Winters time series forecasting algorithm is an on-line (or
310 incremental) algorithm that adaptively predicts future observations in
311 a time series. Its forecast is the sum of three components: a baseline
312 (or intercept), a linear trend over time (or slope), and a seasonal
313 coefficient (a periodic effect, such as a daily cycle). There is one
314 seasonal coefficient for each time point in the period (cycle). After
315 a value is observed, each of these components is updated via
316 exponential smoothing. This means that the algorithm \*(L"learns\*(R" from
317 past values and uses them to predict the future. The rate of
318 adaptation is governed by 3 parameters, alpha (intercept), beta
319 (slope), and gamma (seasonal). The prediction can also be viewed as a
320 smoothed value for the time series.
321 .Sp
322 The measure of deviation is a seasonal weighted absolute
323 deviation. The term \fIseasonal\fR means deviation is measured separately
324 for each time point in the seasonal cycle. As with Holt-Winters
325 forecasting, deviation is predicted using the measure computed from
326 past values (but only at that point in the seasonal cycle). After the
327 value is observed, the algorithm learns from the observed value via
328 exponential smoothing. Confidence bands for the observed time series
329 are generated by scaling the sequence of predicted deviation values
330 (we usually think of the sequence as a continuous line rather than a
331 set of discrete points).
332 .Sp
333 Aberrant behavior (a potential failure) is reported whenever the
334 number of times the observed value violates the confidence bands meets
335 or exceeds a specified threshold within a specified temporal window
336 (e.g. 5 violations during the past 45 minutes with a value observed
337 every 5 minutes).
338 .Sp
339 This functionality is embedded in a set of related \fBRRAs\fR. In
340 particular, a \s-1FAILURES\s0 \fB\s-1RRA\s0\fR logs potential failures. With these data
341 you could, for example, use a front-end application to \fBRRDtool\fR to
342 initiate real-time alerts.
343 .Sp
344 For a detailed description on how to set this up, see rrdcreate.
345 .RE
346 .SS "\s-1REMOTE\s0 \s-1CONTROL\s0"
347 .IX Subsection "REMOTE CONTROL"
348 When you start \fBRRDtool\fR with the command line option '\fB\-\fR' it waits
349 for input via standard input (\s-1STDIN\s0). With this feature you can
350 improve performance by attaching \fBRRDtool\fR to another process (\s-1MRTG\s0
351 is one example) through a set of pipes. Over these pipes \fBRRDtool\fR
352 accepts the same arguments as on the command line and some special
353 commands like \fBquit, cd, mkdir\fR and \fBls\fR. For detailed help on the
354 server commands type:
355 .PP
356 .Vb 1
357 \&   rrdtool help cd|mkdir|pwd|ls|quit
358 .Ve
359 .PP
360 When a command is completed, RRDtool will print the string  '\f(CW\*(C`OK\*(C'\fR',
361 followed by timing information of the form \fBu:\fR\fIusertime\fR
362 \&\fBs:\fR\fIsystemtime\fR. Both values are the running totals of seconds since
363 RRDtool was started. If an error occurs, a line of the form '\f(CW\*(C`ERROR:\*(C'\fR
364 \&\fIDescription of error\fR' will be printed instead. \fBRRDtool\fR will not abort,
365 unless something really serious happens. If
366 a \fBworkdir\fR is specified and the \s-1UID\s0 is 0, RRDtool will do a chroot to that
367 workdir. If the \s-1UID\s0 is not 0, RRDtool only changes the current directory to
368 \&\fBworkdir\fR.
369 .SS "\s-1RRD\s0 Server"
370 .IX Subsection "RRD Server"
371 If you want to create a RRD-Server, you must choose a \s-1TCP/IP\s0 Service
372 number and add them to \fI/etc/services\fR like this:
373 .PP
374 .Vb 1
375 \& rrdsrv      13900/tcp                       # RRD server
376 .Ve
377 .PP
378 Attention: the \s-1TCP\s0 port 13900 isn't officially registered for
379 rrdsrv. You can use any unused port in your services file, but the
380 server and the client system must use the same port, of course.
381 .PP
382 With this configuration you can add RRDtool as meta-server to
383 \&\fI/etc/inetd.conf\fR. For example:
384 .PP
385 .Vb 1
386 \& rrdsrv stream tcp nowait root /opt/rrd/bin/rrdtool rrdtool \- /var/rrd
387 .Ve
388 .PP
389 Don't forget to create the database directory /var/rrd and
390 reinitialize your inetd.
391 .PP
392 If all was setup correctly, you can access the server with Perl
393 sockets, tools like netcat, or in a quick interactive test by using
394 \&'telnet localhost rrdsrv'.
395 .PP
396 \&\fB\s-1NOTE:\s0\fR that there is no authentication with this feature! Do not setup
397 such a port unless you are sure what you are doing.
398 .SH "SEE ALSO"
399 .IX Header "SEE ALSO"
400 rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast, rrdxport
401 .SH "BUGS"
402 .IX Header "BUGS"
403 Bugs? Features!
404 .SH "AUTHOR"
405 .IX Header "AUTHOR"
406 Tobias Oetiker <tobi@oetiker.ch>