Code

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