Code

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