Code

Imported upstream version 1.3.5.
[pkg-rrdtool.git] / doc / rrdtool.html
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>rrdtool</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:root@localhost" />
8 </head>
10 <body style="background-color: white">
12 <p><a name="__index__"></a></p>
13 <!-- INDEX BEGIN -->
14 <!--
16 <ul>
18         <li><a href="#name">NAME</a></li>
19         <li><a href="#synopsis">SYNOPSIS</a></li>
20         <li><a href="#description">DESCRIPTION</a></li>
21         <ul>
23                 <li><a href="#overview">OVERVIEW</a></li>
24                 <li><a href="#functions">FUNCTIONS</a></li>
25                 <li><a href="#how_does_rrdtool_work">HOW DOES RRDTOOL WORK?</a></li>
26                 <li><a href="#remote_control">REMOTE CONTROL</a></li>
27                 <li><a href="#rrd_server">RRD Server</a></li>
28         </ul>
30         <li><a href="#see_also">SEE ALSO</a></li>
31         <li><a href="#bugs">BUGS</a></li>
32         <li><a href="#author">AUTHOR</a></li>
33 </ul>
34 -->
35 <!-- INDEX END -->
37 <p>
38 </p>
39 <h1><a name="name">NAME</a></h1>
40 <p>rrdtool - Round Robin Database Tool</p>
41 <p>
42 </p>
43 <hr />
44 <h1><a name="synopsis">SYNOPSIS</a></h1>
45 <p><strong>rrdtool</strong> <strong>-</strong> [workdir]| <em>function</em></p>
46 <p>
47 </p>
48 <hr />
49 <h1><a name="description">DESCRIPTION</a></h1>
50 <p>
51 </p>
52 <h2><a name="overview">OVERVIEW</a></h2>
53 <p>It is pretty easy to gather status information from all sorts of
54 things, ranging from the temperature in your office to the number of
55 octets which have passed through the FDDI interface of your
56 router. But it is not so trivial to store this data in an efficient and
57 systematic manner. This is where <strong>RRDtool</strong> comes in handy. It lets you
58 <em>log and analyze</em> the data you gather from all kinds of data-sources
59 (<strong>DS</strong>). The data analysis part of RRDtool is based on the ability to
60 quickly generate graphical representations of the data values
61 collected over a definable time period.</p>
62 <p>In this man page you will find general information on the design and
63 functionality of the Round Robin Database Tool (RRDtool). For a more
64 detailed description of how to use the individual functions of
65 <strong>RRDtool</strong> check the corresponding man page.</p>
66 <p>For an introduction to the usage of RRDtool make sure you consult the
67 <a href="././rrdtutorial.html">the rrdtutorial manpage</a>.</p>
68 <p>
69 </p>
70 <h2><a name="functions">FUNCTIONS</a></h2>
71 <p>While the man pages talk of command line switches you have to set in
72 order to make <strong>RRDtool</strong> work it is important to note that
73 <strong>RRDtool</strong> can be remotely controlled through a set of pipes. This
74 saves a considerable amount of startup time when you plan to make
75 <strong>RRDtool</strong> do a lot of things quickly. Check the section on <em>Remote_Control</em>
76 further down. There is also a number of language bindings
77 for RRDtool which allow you to use it directly from perl, python, tcl,
78 php, etc.</p>
79 <dl>
80 <dt><strong><a name="item_create"><strong>create</strong></a></strong></dt>
82 <dd>
83 <p>Set up a new Round Robin Database (RRD). Check <a href="././rrdcreate.html">the rrdcreate manpage</a>.</p>
84 </dd>
85 <dt><strong><a name="item_update"><strong>update</strong></a></strong></dt>
87 <dd>
88 <p>Store new data values into an RRD. Check <a href="././rrdupdate.html">the rrdupdate manpage</a>.</p>
89 </dd>
90 <dt><strong><a name="item_updatev"><strong>updatev</strong></a></strong></dt>
92 <dd>
93 <p>Operationally equivalent to <strong>update</strong> except for output. Check <a href="././rrdupdate.html">the rrdupdate manpage</a>.</p>
94 </dd>
95 <dt><strong><a name="item_graph"><strong>graph</strong></a></strong></dt>
97 <dd>
98 <p>Create a graph from data stored in one or several RRDs. Apart from
99 generating graphs, data can also be extracted to stdout. Check <a href="././rrdgraph.html">the rrdgraph manpage</a>.</p>
100 </dd>
101 <dt><strong><a name="item_dump"><strong>dump</strong></a></strong></dt>
103 <dd>
104 <p>Dump the contents of an RRD in plain ASCII. In connection with restore
105 you can use this to move an RRD from one computer architecture to
106 another.  Check <a href="././rrddump.html">the rrddump manpage</a>.</p>
107 </dd>
108 <dt><strong><a name="item_restore"><strong>restore</strong></a></strong></dt>
110 <dd>
111 <p>Restore an RRD in XML format to a binary RRD. Check <a href="././rrdrestore.html">the rrdrestore manpage</a></p>
112 </dd>
113 <dt><strong><a name="item_fetch"><strong>fetch</strong></a></strong></dt>
115 <dd>
116 <p>Get data for a certain time period from a RRD. The graph function
117 uses fetch to retrieve its data from an RRD. Check <a href="././rrdfetch.html">the rrdfetch manpage</a>.</p>
118 </dd>
119 <dt><strong><a name="item_tune"><strong>tune</strong></a></strong></dt>
121 <dd>
122 <p>Alter setup of an RRD. Check <a href="././rrdtune.html">the rrdtune manpage</a>.</p>
123 </dd>
124 <dt><strong><a name="item_last"><strong>last</strong></a></strong></dt>
126 <dd>
127 <p>Find the last update time of an RRD. Check <a href="././rrdlast.html">the rrdlast manpage</a>.</p>
128 </dd>
129 <dt><strong><a name="item_info"><strong>info</strong></a></strong></dt>
131 <dd>
132 <p>Get information about an RRD. Check <a href="././rrdinfo.html">the rrdinfo manpage</a>.</p>
133 </dd>
134 <dt><strong><a name="item_rrdresize"><strong>rrdresize</strong></a></strong></dt>
136 <dd>
137 <p>Change the size of individual RRAs. This is dangerous! Check <a href="././rrdresize.html">the rrdresize manpage</a>.</p>
138 </dd>
139 <dt><strong><a name="item_xport"><strong>xport</strong></a></strong></dt>
141 <dd>
142 <p>Export data retrieved from one or several RRDs. Check <a href="././rrdxport.html">the rrdxport manpage</a></p>
143 </dd>
144 <dt><strong><a name="item_rrdcgi"><strong>rrdcgi</strong></a></strong></dt>
146 <dd>
147 <p>This is a standalone tool for producing RRD graphs on the fly. Check
148 <a href="././rrdcgi.html">the rrdcgi manpage</a>.</p>
149 </dd>
150 </dl>
151 <p>
152 </p>
153 <h2><a name="how_does_rrdtool_work">HOW DOES RRDTOOL WORK?</a></h2>
154 <dl>
155 <dt><strong><a name="item_data_acquisition">Data Acquisition</a></strong></dt>
157 <dd>
158 <p>When monitoring the state of a system, it is convenient to have the
159 data available at a constant time interval. Unfortunately, you may not
160 always be able to fetch data at exactly the time you want
161 to. Therefore <strong>RRDtool</strong> lets you update the logfile at any time you
162 want. It will automatically interpolate the value of the data-source
163 (<strong>DS</strong>) at the latest official time-slot (intervall) and write this
164 interpolated value to the log. The original value you have supplied is
165 stored as well and is also taken into account when interpolating the
166 next log entry.</p>
167 </dd>
168 <dt><strong><a name="item_consolidation">Consolidation</a></strong></dt>
170 <dd>
171 <p>You may log data at a 1 minute interval, but you might also be
172 interested to know the development of the data over the last year. You
173 could do this by simply storing the data in 1 minute intervals for the
174 whole year. While this would take considerable disk space it would
175 also take a lot of time to analyze the data when you wanted to create
176 a graph covering the whole year. <strong>RRDtool</strong> offers a solution to this
177 problem through its data consolidation feature. When setting up an
178 Round Robin Database (<strong>RRD</strong>), you can define at which interval this
179 consolidation should occur, and what consolidation function (<strong>CF</strong>)
180 (average, minimum, maximum, total, last) should be used to build the
181 consolidated values (see rrdcreate). You can define any number of
182 different consolidation setups within one <strong>RRD</strong>. They will all be
183 maintained on the fly when new data is loaded into the <strong>RRD</strong>.</p>
184 </dd>
185 <dt><strong><a name="item_round_robin_archives">Round Robin Archives</a></strong></dt>
187 <dd>
188 <p>Data values of the same consolidation setup are stored into Round
189 Robin Archives (<strong>RRA</strong>). This is a very efficient manner to store data
190 for a certain amount of time, while using a known and constant amount
191 of storage space.</p>
192 <p>It works like this: If you want to store 1'000 values in 5 minute
193 interval, <strong>RRDtool</strong> will allocate space for 1'000 data values and a
194 header area. In the header it will store a pointer telling which slots
195 (value) in the storage area was last written to. New values are
196 written to the Round Robin Archive in, you guessed it, a round robin
197 manner. This automatically limits the history to the last 1'000 values
198 (in our example). Because you can define several <strong>RRA</strong>s within a
199 single <strong>RRD</strong>, you can setup another one, for storing 750 data values
200 at a 2 hour interval, for example, and thus keep a log for the last
201 two months at a lower resolution.</p>
202 <p>The use of <strong>RRA</strong>s guarantees that the <strong>RRD</strong> does not grow over
203 time and that old data is automatically eliminated. By using the
204 consolidation feature, you can still keep data for a very long time,
205 while gradually reducing the resolution of the data along the time
206 axis.</p>
207 <p>Using different consolidation functions (<strong>CF</strong>) allows you to store
208 exactly the type of information that actually interests you: the maximum
209 one minute traffic on the LAN, the minimum temperature of your wine cellar,
210 the total minutes of down time, etc.</p>
211 </dd>
212 <dt><strong><a name="item_unknown_data">Unknown Data</a></strong></dt>
214 <dd>
215 <p>As mentioned earlier, the <strong>RRD</strong> stores data at a constant
216 interval. Sometimes it may happen that no new data is available when a
217 value has to be written to the <strong>RRD</strong>. Data acquisition may not be
218 possible for one reason or other. With <strong>RRDtool</strong> you can handle these
219 situations by storing an <em>*UNKNOWN*</em> value into the database. The
220 value '<em>*UNKNOWN*</em>' is supported through all the functions of the
221 tool. When consolidating a data set, the amount of <em>*UNKNOWN*</em> data
222 values is accounted for and when a new consolidated value is ready to
223 be written to its Round Robin Archive (<strong>RRA</strong>), a validity check is
224 performed to make sure that the percentage of unknown values in the
225 data point is above a configurable level. If not, an <em>*UNKNOWN*</em> value
226 will be written to the <strong>RRA</strong>.</p>
227 </dd>
228 <dt><strong><a name="item_graphing">Graphing</a></strong></dt>
230 <dd>
231 <p><strong>RRDtool</strong> allows you to generate reports in numerical and
232 graphical form based on the data stored in one or several
233 <strong>RRD</strong>s. The graphing feature is fully configurable. Size, color and
234 contents of the graph can be defined freely. Check <a href="././rrdgraph.html">the rrdgraph manpage</a>
235 for more information on this.</p>
236 </dd>
237 <dt><strong><a name="item_aberrant_behavior_detection">Aberrant Behavior Detection</a></strong></dt>
239 <dd>
240 <p>by Jake Brutlag</p>
241 <p><strong>RRDtool</strong> provides the building blocks for near real-time aberrant
242 behavior detection. These components include:</p>
243 <ul>
244 <li>
245 <p>An algorithm for predicting the value of a time series one time step
246 into the future.</p>
247 </li>
248 <li>
249 <p>A measure of deviation between predicted and observed values.</p>
250 </li>
251 <li>
252 <p>A mechanism to decide if and when an observed value or sequence of
253 observed values is <em>too deviant</em> from the predicted value(s).</p>
254 </li>
255 </ul>
256 <p>Here is a brief explanation of these components:</p>
257 <p>The Holt-Winters time series forecasting algorithm is an on-line (or
258 incremental) algorithm that adaptively predicts future observations in
259 a time series. Its forecast is the sum of three components: a baseline
260 (or intercept), a linear trend over time (or slope), and a seasonal
261 coefficient (a periodic effect, such as a daily cycle). There is one
262 seasonal coefficient for each time point in the period (cycle). After
263 a value is observed, each of these components is updated via
264 exponential smoothing. This means that the algorithm ``learns'' from
265 past values and uses them to predict the future. The rate of
266 adaptation is governed by 3 parameters, alpha (intercept), beta
267 (slope), and gamma (seasonal). The prediction can also be viewed as a
268 smoothed value for the time series.</p>
269 <p>The measure of deviation is a seasonal weighted absolute
270 deviation. The term <em>seasonal</em> means deviation is measured separately
271 for each time point in the seasonal cycle. As with Holt-Winters
272 forecasting, deviation is predicted using the measure computed from
273 past values (but only at that point in the seasonal cycle). After the
274 value is observed, the algorithm learns from the observed value via
275 exponential smoothing. Confidence bands for the observed time series
276 are generated by scaling the sequence of predicted deviation values
277 (we usually think of the sequence as a continuous line rather than a
278 set of discrete points).</p>
279 <p>Aberrant behavior (a potential failure) is reported whenever the
280 number of times the observed value violates the confidence bands meets
281 or exceeds a specified threshold within a specified temporal window
282 (e.g. 5 violations during the past 45 minutes with a value observed
283 every 5 minutes).</p>
284 <p>This functionality is embedded in a set of related <strong>RRAs</strong>. In
285 particular, a FAILURES <strong>RRA</strong> logs potential failures. With these data
286 you could, for example, use a front-end application to <strong>RRDtool</strong> to
287 initiate real-time alerts.</p>
288 <p>For a detailed description on how to set this up, see <a href="././rrdcreate.html">the rrdcreate manpage</a>.</p>
289 </dd>
290 </dl>
291 <p>
292 </p>
293 <h2><a name="remote_control">REMOTE CONTROL</a></h2>
294 <p>When you start <strong>RRDtool</strong> with the command line option '<strong>-</strong>' it waits
295 for input via standard input (STDIN). With this feature you can
296 improve performance by attaching <strong>RRDtool</strong> to another process (MRTG
297 is one example) through a set of pipes. Over these pipes <strong>RRDtool</strong>
298 accepts the same arguments as on the command line and some special
299 commands like <strong>quit, cd, mkdir</strong> and <strong>ls</strong>. For detailed help on the
300 server commands type:</p>
301 <pre>
302    rrdtool help cd|mkdir|pwd|ls|quit</pre>
303 <p>When a command is completed, RRDtool will print the string  '<code>OK</code>',
304 followed by timing information of the form <strong>u:</strong><em>usertime</em>
305 <strong>s:</strong><em>systemtime</em>. Both values are the running totals of seconds since
306 RRDtool was started. If an error occurs, a line of the form '<code>ERROR:</code>
307 <em>Description of error</em>' will be printed instead. <strong>RRDtool</strong> will not abort,
308 unless something realy serious happens. If
309 a <strong>workdir</strong> is specified and the UID is 0, RRDtool will do a chroot to that
310 workdir. If the UID is not 0, RRDtool only changes the current directory to
311 <strong>workdir</strong>.</p>
312 <p>
313 </p>
314 <h2><a name="rrd_server">RRD Server</a></h2>
315 <p>If you want to create a RRD-Server, you must choose a TCP/IP Service
316 number and add them to <em>/etc/services</em> like this:</p>
317 <pre>
318  rrdsrv      13900/tcp                       # RRD server</pre>
319 <p>Attention: the TCP port 13900 isn't officially registered for
320 rrdsrv. You can use any unused port in your services file, but the
321 server and the client system must use the same port, of course.</p>
322 <p>With this configuration you can add RRDtool as meta-server to
323 <em>/etc/inetd.conf</em>. For example:</p>
324 <pre>
325  rrdsrv stream tcp nowait root /opt/rrd/bin/rrdtool rrdtool - /var/rrd</pre>
326 <p>Don't forget to create the database directory /var/rrd and
327 reinitialize your inetd.</p>
328 <p>If all was setup correctly, you can access the server with perl
329 sockets, tools like netcat, or in a quick interactive test by using
330 'telnet localhost rrdsrv'.</p>
331 <p><strong>NOTE:</strong> that there is no authentication with this feature! Do not setup
332 such a port unless you are sure what you are doing.</p>
333 <p>
334 </p>
335 <hr />
336 <h1><a name="see_also">SEE ALSO</a></h1>
337 <p>rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast, rrdxport</p>
338 <p>
339 </p>
340 <hr />
341 <h1><a name="bugs">BUGS</a></h1>
342 <p>Bugs? Features!</p>
343 <p>
344 </p>
345 <hr />
346 <h1><a name="author">AUTHOR</a></h1>
347 <p>Tobias Oetiker &lt;<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>&gt;</p>
349 </body>
351 </html>