1RRDTOOL(1) rrdtool RRDTOOL(1)
2
3
4
6 rrdtool - Round Robin Database Tool
7
9 rrdtool - [workdir]| function
10
12 OVERVIEW
13
14 It is pretty easy to gather status information from all sorts of
15 things, ranging from the temperature in your office to the number of
16 octets which have passed through the FDDI interface of your router. But
17 it is not so trivial to store this data in an efficient and systematic
18 manner. This is where RRDtool comes in handy. It lets you log and ana‐
19 lyze the data you gather from all kinds of data-sources (DS). The data
20 analysis part of RRDtool is based on the ability to quickly generate
21 graphical representations of the data values collected over a definable
22 time period.
23
24 In this man page you will find general information on the design and
25 functionality of the Round Robin Database Tool (RRDtool). For a more
26 detailed description of how to use the individual functions of RRDtool
27 check the corresponding man page.
28
29 For an introduction to the usage of RRDtool make sure you consult the
30 rrdtutorial.
31
32 FUNCTIONS
33
34 While the man pages talk of command line switches you have to set in
35 order to make RRDtool work it is important to note that RRDtool can be
36 remotely controlled through a set of pipes. This saves a considerable
37 amount of startup time when you plan to make RRDtool do a lot of things
38 quickly. Check the section on "Remote Control" further down. There is
39 also a number of language bindings for RRDtool which allow you to use
40 it directly from perl, python, tcl, php, etc.
41
42 create Set up a new Round Robin Database (RRD). Check rrdcreate.
43
44 update Store new data values into an RRD. Check rrdupdate.
45
46 updatev Operationally equivalent to update except for output. Check
47 rrdupdate.
48
49 graph Create a graph from data stored in one or several RRDs. Apart
50 from generating graphs, data can also be extracted to stdout.
51 Check rrdgraph.
52
53 dump Dump the contents of an RRD in plain ASCII. In connection with
54 restore you can use this to move an RRD from one computer
55 architecture to another. Check rrddump.
56
57 restore Restore an RRD in XML format to a binary RRD. Check rrdrestore
58
59 fetch Get data for a certain time period from a RRD. The graph func‐
60 tion uses fetch to retrieve its data from an RRD. Check rrd‐
61 fetch.
62
63 tune Alter setup of an RRD. Check rrdtune.
64
65 last Find the last update time of an RRD. Check rrdlast.
66
67 info Get information about an RRD. Check rrdinfo.
68
69 rrdresize
70 Change the size of individual RRAs. This is dangerous! Check
71 rrdresize.
72
73 xport Export data retrieved from one or several RRDs. Check rrdxport
74
75 rrdcgi This is a standalone tool for producing RRD graphs on the fly.
76 Check rrdcgi.
77
78 HOW DOES RRDTOOL WORK?
79
80 Data Acquisition
81 When monitoring the state of a system, it is convenient to have
82 the data available at a constant time interval. Unfortunately,
83 you may not always be able to fetch data at exactly the time
84 you want to. Therefore RRDtool lets you update the logfile at
85 any time you want. It will automatically interpolate the value
86 of the data-source (DS) at the latest official time-slot
87 (intervall) and write this interpolated value to the log. The
88 original value you have supplied is stored as well and is also
89 taken into account when interpolating the next log entry.
90
91 Consolidation
92 You may log data at a 1 minute interval, but you might also be
93 interested to know the development of the data over the last
94 year. You could do this by simply storing the data in 1 minute
95 intervals for the whole year. While this would take consider‐
96 able disk space it would also take a lot of time to analyze the
97 data when you wanted to create a graph covering the whole year.
98 RRDtool offers a solution to this problem through its data con‐
99 solidation feature. When setting up an Round Robin Database
100 (RRD), you can define at which interval this consolidation
101 should occur, and what consolidation function (CF) (average,
102 minimum, maximum, total, last) should be used to build the con‐
103 solidated values (see rrdcreate). You can define any number of
104 different consolidation setups within one RRD. They will all be
105 maintained on the fly when new data is loaded into the RRD.
106
107 Round Robin Archives
108 Data values of the same consolidation setup are stored into
109 Round Robin Archives (RRA). This is a very efficient manner to
110 store data for a certain amount of time, while using a known
111 and constant amount of storage space.
112
113 It works like this: If you want to store 1'000 values in 5
114 minute interval, RRDtool will allocate space for 1'000 data
115 values and a header area. In the header it will store a pointer
116 telling which slots (value) in the storage area was last writ‐
117 ten to. New values are written to the Round Robin Archive in,
118 you guessed it, a round robin manner. This automatically limits
119 the history to the last 1'000 values (in our example). Because
120 you can define several RRAs within a single RRD, you can setup
121 another one, for storing 750 data values at a 2 hour interval,
122 for example, and thus keep a log for the last two months at a
123 lower resolution.
124
125 The use of RRAs guarantees that the RRD does not grow over time
126 and that old data is automatically eliminated. By using the
127 consolidation feature, you can still keep data for a very long
128 time, while gradually reducing the resolution of the data along
129 the time axis.
130
131 Using different consolidation functions (CF) allows you to
132 store exactly the type of information that actually interests
133 you: the maximum one minute traffic on the LAN, the minimum
134 temperature of your wine cellar, the total minutes of down
135 time, etc.
136
137 Unknown Data
138 As mentioned earlier, the RRD stores data at a constant inter‐
139 val. Sometimes it may happen that no new data is available when
140 a value has to be written to the RRD. Data acquisition may not
141 be possible for one reason or other. With RRDtool you can han‐
142 dle these situations by storing an *UNKNOWN* value into the
143 database. The value '*UNKNOWN*' is supported through all the
144 functions of the tool. When consolidating a data set, the
145 amount of *UNKNOWN* data values is accounted for and when a new
146 consolidated value is ready to be written to its Round Robin
147 Archive (RRA), a validity check is performed to make sure that
148 the percentage of unknown values in the data point is above a
149 configurable level. If not, an *UNKNOWN* value will be written
150 to the RRA.
151
152 Graphing
153 RRDtool allows you to generate reports in numerical and graphi‐
154 cal form based on the data stored in one or several RRDs. The
155 graphing feature is fully configurable. Size, color and con‐
156 tents of the graph can be defined freely. Check rrdgraph for
157 more information on this.
158
159 Aberrant Behavior Detection
160 by Jake Brutlag
161
162 RRDtool provides the building blocks for near real-time aber‐
163 rant behavior detection. These components include:
164
165 * An algorithm for predicting the value of a time series one
166 time step into the future.
167
168 * A measure of deviation between predicted and observed val‐
169 ues.
170
171 * A mechanism to decide if and when an observed value or
172 sequence of observed values is too deviant from the pre‐
173 dicted value(s).
174
175 Here is a brief explanation of these components:
176
177 The Holt-Winters time series forecasting algorithm is an on-
178 line (or incremental) algorithm that adaptively predicts future
179 observations in a time series. Its forecast is the sum of three
180 components: a baseline (or intercept), a linear trend over time
181 (or slope), and a seasonal coefficient (a periodic effect, such
182 as a daily cycle). There is one seasonal coefficient for each
183 time point in the period (cycle). After a value is observed,
184 each of these components is updated via exponential smoothing.
185 This means that the algorithm "learns" from past values and
186 uses them to predict the future. The rate of adaptation is gov‐
187 erned by 3 parameters, alpha (intercept), beta (slope), and
188 gamma (seasonal). The prediction can also be viewed as a
189 smoothed value for the time series.
190
191 The measure of deviation is a seasonal weighted absolute devia‐
192 tion. The term seasonal means deviation is measured separately
193 for each time point in the seasonal cycle. As with Holt-Winters
194 forecasting, deviation is predicted using the measure computed
195 from past values (but only at that point in the seasonal
196 cycle). After the value is observed, the algorithm learns from
197 the observed value via exponential smoothing. Confidence bands
198 for the observed time series are generated by scaling the
199 sequence of predicted deviation values (we usually think of the
200 sequence as a continuous line rather than a set of discrete
201 points).
202
203 Aberrant behavior (a potential failure) is reported whenever
204 the number of times the observed value violates the confidence
205 bands meets or exceeds a specified threshold within a specified
206 temporal window (e.g. 5 violations during the past 45 minutes
207 with a value observed every 5 minutes).
208
209 This functionality is embedded in a set of related RRAs. In
210 particular, a FAILURES RRA logs potential failures. With these
211 data you could, for example, use a front-end application to
212 RRDtool to initiate real-time alerts.
213
214 For a detailed description on how to set this up, see rrdcre‐
215 ate.
216
217 REMOTE CONTROL
218
219 When you start RRDtool with the command line option '-' it waits for
220 input via standard input (STDIN). With this feature you can improve
221 performance by attaching RRDtool to another process (MRTG is one exam‐
222 ple) through a set of pipes. Over these pipes RRDtool accepts the same
223 arguments as on the command line and some special commands like quit,
224 cd, mkdir and ls. For detailed help on the server commands type:
225
226 rrdtool help cd|mkdir|pwd|ls|quit
227
228 When a command is completed, RRDtool will print the string '"OK"',
229 followed by timing information of the form u:usertime s:systemtime.
230 Both values are the running totals of seconds since RRDtool was
231 started. If an error occurs, a line of the form '"ERROR:" Description
232 of error' will be printed instead. RRDtool will not abort, unless some‐
233 thing realy serious happens. If a workdir is specified and the UID is
234 0, RRDtool will do a chroot to that workdir. If the UID is not 0, RRD‐
235 tool only changes the current directory to workdir.
236
237 RRD Server
238
239 If you want to create a RRD-Server, you must choose a TCP/IP Service
240 number and add them to /etc/services like this:
241
242 rrdsrv 13900/tcp # RRD server
243
244 Attention: the TCP port 13900 isn't officially registered for rrdsrv.
245 You can use any unused port in your services file, but the server and
246 the client system must use the same port, of course.
247
248 With this configuration you can add RRDtool as meta-server to
249 /etc/inetd.conf. For example:
250
251 rrdsrv stream tcp nowait root /opt/rrd/bin/rrdtool rrdtool - /var/rrd
252
253 Don't forget to create the database directory /var/rrd and reinitialize
254 your inetd.
255
256 If all was setup correctly, you can access the server with perl sock‐
257 ets, tools like netcat, or in a quick interactive test by using 'telnet
258 localhost rrdsrv'.
259
260 NOTE: that there is no authentication with this feature! Do not setup
261 such a port unless you are sure what you are doing.
262
264 rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast,
265 rrdxport
266
268 Bugs? Features!
269
271 Tobias Oetiker <tobi@oetiker.ch>
272
273
274
2751.2.27 2008-02-17 RRDTOOL(1)