1 RRDCREATE(1) rrdtool RRDCREATE(1)
6 rrdcreate - Set up a new Round Robin Database
9 r\brr\brd\bdt\bto\boo\bol\bl c\bcr\bre\bea\bat\bte\be _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be [-\b--\b-s\bst\bta\bar\brt\bt|-\b-b\bb _\bs_\bt_\ba_\br_\bt _\bt_\bi_\bm_\be] [-\b--\b-s\bst\bte\bep\bp|-\b-s\bs _\bs_\bt_\be_\bp]
10 [D\bDS\bS:\b:_\bd_\bs_\b-_\bn_\ba_\bm_\be:\b:_\bD_\bS_\bT:\b:_\bd_\bs_\bt _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs] [R\bRR\bRA\bA:\b:_\bC_\bF:\b:_\bc_\bf _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs]
13 The create function of RRDtool lets you set up new Round Robin Database
22 Specifies the time in seconds since 1970-01-01 UTC when the first
24 timed before or at the time specified.
27 mentation for other ways to specify time.
30 Specifies the base interval in seconds with which data will be fed
33 D\bDS\bS:\b:_\bd_\bs_\b-_\bn_\ba_\bm_\be:\b:_\bD_\bS_\bT:\b:_\bd_\bs_\bt _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs
35 example incoming and outgoing traffic on a specific communication
41 the characters [a-zA-Z0-9_].
44 source entry depend on the data source type. For GAUGE, COUNTER,
45 DERIVE, and ABSOLUTE the format for a data source entry is:
47 D\bDS\bS:\b:_\bd_\bs_\b-_\bn_\ba_\bm_\be:\b:_\bG_\bA_\bU_\bG_\bE _\b| _\bC_\bO_\bU_\bN_\bT_\bE_\bR _\b| _\bD_\bE_\bR_\bI_\bV_\bE _\b| _\bA_\bB_\bS_\bO_\bL_\bU_\bT_\bE:\b:_\bh_\be_\ba_\br_\bt_\bb_\be_\ba_\bt:\b:_\bm_\bi_\bn:\b:_\bm_\ba_\bx
49 For COMPUTE data sources, the format is:
51 D\bDS\bS:\b:_\bd_\bs_\b-_\bn_\ba_\bm_\be:\b:_\bC_\bO_\bM_\bP_\bU_\bT_\bE:\b:_\br_\bp_\bn_\b-_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
53 In order to decide which data source type to use, review the defi-
54 nitions that follow. Also consult the section on "HOW TO MEASURE"
55 for further insight.
58 is for things like temperatures or number of people in a room
59 or the value of a RedHat share.
62 is for continuous incrementing counters like the ifInOctets
64 counter never decreases, except when a counter overflows. The
65 update function takes the overflow into account. The counter
66 is stored as a per-second rate. When the counter overflows,
67 RRDtool checks if the overflow happened at the 32bit or 64bit
68 border and acts accordingly by adding an appropriate value to
69 the result.
72 will store the derivative of the line going from the last to
73 the current value of the data source. This can be useful for
74 gauges, for example, to measure the rate of people entering or
75 leaving a room. Internally, derive works exactly like COUNTER
76 but without overflow checks. So if your counter does not reset
77 at 32 or 64 bit you might want to use DERIVE and combine it
78 with a MIN value of 0.
80 NOTE on COUNTER vs DERIVE
82 by Don Baarda <don.baarda@baesystems.com>
84 If you cannot tolerate ever mistaking the occasional counter
85 reset for a legitimate counter wrap, and would prefer
86 "Unknowns" for all legitimate counter wraps and resets, always
87 use DERIVE with min=0. Otherwise, using COUNTER with a suitable
88 max will return correct values for all legitimate counter
89 wraps, mark some counter resets as "Unknown", but can mistake
90 some counter resets for a legitimate counter wrap.
92 For a 5 minute step and 32-bit counter, the probability of mis-
93 taking a counter reset for a legitimate wrap is arguably about
94 0.8% per 1Mbps of maximum bandwidth. Note that this equates to
95 80% for 100Mbps interfaces, so for high bandwidth interfaces
96 and a 32bit counter, DERIVE with min=0 is probably preferable.
97 If you are using a 64bit counter, just about any max setting
98 will eliminate the possibility of mistaking a reset for a
99 counter wrap.
102 is for counters which get reset upon reading. This is used for
103 fast counters which tend to overflow. So instead of reading
104 them normally you reset them after every read to make sure you
105 have a maximum time available before the next overflow. Another
106 usage is for things you count like number of messages since the
107 last update.
110 is for storing the result of a formula applied to other data
112 update, but rather its Primary Data Points (PDPs) are computed
113 from the PDPs of the data sources according to the rpn-expres-
114 sion that defines the formula. Consolidation functions are then
115 applied normally to the PDPs of the COMPUTE data source (that
116 is the rpn-expression is only applied to generate PDPs). In
117 database software, such data sets are referred to as "virtual"
118 or "computed" columns.
121 between two updates of this data source before the value of the
127 and max, set them to U for unknown. Note that min and max always
129 DS this would be the maximum and minimum data-rate expected from
130 the device.
132 _\bI_\bf _\bi_\bn_\bf_\bo_\br_\bm_\ba_\bt_\bi_\bo_\bn _\bo_\bn _\bm_\bi_\bn_\bi_\bm_\ba_\bl_\b/_\bm_\ba_\bx_\bi_\bm_\ba_\bl _\be_\bx_\bp_\be_\bc_\bt_\be_\bd _\bv_\ba_\bl_\bu_\be_\bs _\bi_\bs _\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bl_\be_\b,
133 _\ba_\bl_\bw_\ba_\by_\bs _\bs_\be_\bt _\bt_\bh_\be _\bm_\bi_\bn _\ba_\bn_\bd_\b/_\bo_\br _\bm_\ba_\bx _\bp_\br_\bo_\bp_\be_\br_\bt_\bi_\be_\bs_\b. _\bT_\bh_\bi_\bs _\bw_\bi_\bl_\bl _\bh_\be_\bl_\bp _\bR_\bR_\bD_\bt_\bo_\bo_\bl _\bi_\bn
134 _\bd_\bo_\bi_\bn_\bg _\ba _\bs_\bi_\bm_\bp_\bl_\be _\bs_\ba_\bn_\bi_\bt_\by _\bc_\bh_\be_\bc_\bk _\bo_\bn _\bt_\bh_\be _\bd_\ba_\bt_\ba _\bs_\bu_\bp_\bp_\bl_\bi_\be_\bd _\bw_\bh_\be_\bn _\br_\bu_\bn_\bn_\bi_\bn_\bg
137 _\br_\bp_\bn_\b-_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn defines the formula used to compute the PDPs of a
138 COMPUTE data source from other data sources in the same <RRD>. It
140 Please refer to that manual page for a list and description of RPN
141 operations supported. For COMPUTE data sources, the following RPN
142 operations are not supported: COUNT, PREV, TIME, and LTIME. In
143 addition, in defining the RPN expression, the COMPUTE data source
144 may only refer to the names of data source listed previously in the
147 command.
160 the archive. There are several consolidation functions that consol-
161 idate primary data points via an aggregate function: A\bAV\bVE\bER\bRA\bAG\bGE\bE, M\bMI\bIN\bN,
162 M\bMA\bAX\bX, L\bLA\bAS\bST\bT. The format of R\bRR\bRA\bA line for these consolidation functions
163 is:
165 R\bRR\bRA\bA:\b:_\bA_\bV_\bE_\bR_\bA_\bG_\bE _\b| _\bM_\bI_\bN _\b| _\bM_\bA_\bX _\b| _\bL_\bA_\bS_\bT:\b:_\bx_\bf_\bf:\b:_\bs_\bt_\be_\bp_\bs:\b:_\br_\bo_\bw_\bs
169 still regarded as known. It is given as the ratio of allowed
171 ranges from 0 to 1 (exclusive).
173 _\bs_\bt_\be_\bp_\bs defines how many of these _\bp_\br_\bi_\bm_\ba_\br_\by _\bd_\ba_\bt_\ba _\bp_\bo_\bi_\bn_\bt_\bs are used to
174 build a _\bc_\bo_\bn_\bs_\bo_\bl_\bi_\bd_\ba_\bt_\be_\bd _\bd_\ba_\bt_\ba _\bp_\bo_\bi_\bn_\bt which then goes into the archive.
179 A\bAb\bbe\ber\brr\bra\ban\bnt\bt B\bBe\beh\bha\bav\bvi\bio\bor\br D\bDe\bet\bte\bec\bct\bti\bio\bon\bn w\bwi\bit\bth\bh H\bHo\bol\blt\bt-\b-W\bWi\bin\bnt\bte\ber\brs\bs F\bFo\bor\bre\bec\bca\bas\bst\bti\bin\bng\bg
180 In addition to the aggregate functions, there are a set of specialized
182 Winters forecasting algorithm), confidence bands, and the flagging
183 aberrant behavior in the data source time series:
185 · R\bRR\bRA\bA:\b:_\bH_\bW_\bP_\bR_\bE_\bD_\bI_\bC_\bT:\b:_\br_\bo_\bw_\bs:\b:_\ba_\bl_\bp_\bh_\ba:\b:_\bb_\be_\bt_\ba:\b:_\bs_\be_\ba_\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd[:\b:_\br_\br_\ba_\b-_\bn_\bu_\bm]
187 · R\bRR\bRA\bA:\b:_\bS_\bE_\bA_\bS_\bO_\bN_\bA_\bL:\b:_\bs_\be_\ba_\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd:\b:_\bg_\ba_\bm_\bm_\ba:\b:_\br_\br_\ba_\b-_\bn_\bu_\bm
189 · R\bRR\bRA\bA:\b:_\bD_\bE_\bV_\bS_\bE_\bA_\bS_\bO_\bN_\bA_\bL:\b:_\bs_\be_\ba_\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd:\b:_\bg_\ba_\bm_\bm_\ba:\b:_\br_\br_\ba_\b-_\bn_\bu_\bm
191 · R\bRR\bRA\bA:\b:_\bD_\bE_\bV_\bP_\bR_\bE_\bD_\bI_\bC_\bT:\b:_\br_\bo_\bw_\bs:\b:_\br_\br_\ba_\b-_\bn_\bu_\bm
193 · R\bRR\bRA\bA:\b:_\bF_\bA_\bI_\bL_\bU_\bR_\bE_\bS:\b:_\br_\bo_\bw_\bs:\b:_\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd:\b:_\bw_\bi_\bn_\bd_\bo_\bw _\bl_\be_\bn_\bg_\bt_\bh:\b:_\br_\br_\ba_\b-_\bn_\bu_\bm
198 confidence bounds, a matched set of HWPREDICT, SEASONAL, DEVSEASONAL,
199 and DEVPREDICT must exist. Generating smoothed values of the primary
201 behavior detection requires FAILURES, HWPREDICT, DEVSEASONAL, and SEA-
202 SONAL.
204 The actual predicted, or smoothed, values are stored in the HWPREDICT
206 dard deviation which can be scaled to yield a confidence band). The
208 tion as failure; that is, the number of confidence bounds violations in
209 the preceding window of observations met or exceeded a specified
211 and failures appears in rrdgraph.
214 the Holt-Winters forecasting algorithm and the seasonal deviations,
215 respectively. There is one entry per observation time point in the
216 seasonal cycle. For example, if primary data points are generated every
217 five minutes and the seasonal cycle is 1 day, both SEASONAL and DEVSEA-
218 SONAL will have 288 rows.
220 In order to simplify the creation for the novice user, in addition to
221 supporting explicit creation of the HWPREDICT, SEASONAL, DEVPREDICT,
222 DEVSEASONAL, and FAILURES R\bRR\bRA\bAs\bs, the R\bRR\bRD\bDt\bto\boo\bol\bl create command supports
223 implicit creation of the other four when HWPREDICT is specified alone
227 that there is a one-to-one correspondence between primary data points
229 than the _\bs_\be_\ba_\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd. If the DEVPREDICT R\bRR\bRA\bA is implicitly created,
231 If the FAILURES R\bRR\bRA\bA is implicitly created, _\br_\bo_\bw_\bs will be set to the _\bs_\be_\ba_\b-
232 _\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd argument of the HWPREDICT R\bRR\bRA\bA. Of course, the R\bRR\bRD\bDt\bto\boo\bol\bl
234 the creator wishes to avoid explicit creations of the other specialized
237 _\bs_\be_\ba_\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd specifies the number of primary data points in a sea-
238 sonal cycle. If SEASONAL and DEVSEASONAL are implicitly created, this
240 HWPREDICT. If they are explicitly created, the creator should verify
244 cient in the Holt-Winters forecasting algorithm. See rrdtool for a
246 closer to 1 means that more recent observations carry greater weight in
247 predicting the baseline component of the forecast. A value closer to 0
248 means that past history carries greater weight in predicting the base-
249 line component.
254 linear trend.
257 Holt-Winters forecasting algorithm (HWPREDICT) or the adaption parame-
258 ter in the exponential smoothing update of the seasonal deviations. It
262 there is one seasonal coefficient (or deviation) for each time point
263 during the seasonal cycle, the adaptation rate is much slower than the
264 baseline. Each seasonal coefficient is only updated (or adapts) when
265 the observed value occurs at the offset in the seasonal cycle corre-
266 sponding to that coefficient.
268 If SEASONAL and DEVSEASONAL R\bRR\bRA\bAs\bs are created explicitly, _\bg_\ba_\bm_\bm_\ba need not
269 be the same for both. Note that _\bg_\ba_\bm_\bm_\ba can also be changed via the R\bRR\bRD\bD-\b-
272 _\br_\br_\ba_\b-_\bn_\bu_\bm provides the links between related R\bRR\bRA\bAs\bs. If HWPREDICT is speci-
277 The _\br_\br_\ba_\b-_\bn_\bu_\bm argument is the 1-based index in the order of R\bRR\bRA\bA creation
279 R\bRR\bRA\bA for each R\bRR\bRA\bA requiring the _\br_\br_\ba_\b-_\bn_\bu_\bm argument is listed here:
291 _\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd is the minimum number of violations (observed values outside
292 the confidence bounds) within a window that constitutes a failure. If
295 _\bw_\bi_\bn_\bd_\bo_\bw _\bl_\be_\bn_\bg_\bt_\bh is the number of time points in the window. Specify an
296 integer greater than or equal to the threshold and less than or equal
297 to 28. The time interval this window represents depends on the inter-
299 ated, the default value is 9.
302 Here is an explanation by Don Baarda on the inner workings of RRDtool.
303 It may help you to sort out why all this *UNKNOWN* data is popping up
304 in your databases:
306 RRDtool gets fed samples/updates at arbitrary times. From these it
307 builds Primary Data Points (PDPs) on every "step" interval. The PDPs
308 are then accumulated into the RRAs.
310 The "heartbeat" defines the maximum acceptable interval between sam-
311 ples/updates. If the interval between samples is less than "heartbeat",
312 then an average rate is calculated and applied for that interval. If
313 the interval between samples is longer than "heartbeat", then that
314 entire interval is considered "unknown". Note that there are other
315 things that can make a sample interval "unknown", such as the rate
316 exceeding limits, or a sample that was explicitly marked as unknown.
318 The known rates during a PDP's "step" interval are used to calculate an
319 average rate for that PDP. If the total "unknown" time accounts for
321 means that a mixture of known and "unknown" sample times in a single
322 PDP "step" may or may not add up to enough "known" time to warrent for
323 a known PDP.
325 The "heartbeat" can be short (unusual) or long (typical) relative to
326 the "step" interval between PDPs. A short "heartbeat" means you require
327 multiple samples per PDP, and if you don't get them mark the PDP
328 unknown. A long heartbeat can span multiple "steps", which means it is
329 acceptable to have multiple PDPs calculated from a single sample. An
330 extreme example of this might be a "step" of 5 minutes and a
331 "heartbeat" of one day, in which case a single sample every day will
332 result in all the PDPs for that entire day period being set to the same
333 average rate. _\b-_\b- _\bD_\bo_\bn _\bB_\ba_\ba_\br_\bd_\ba _\b<_\bd_\bo_\bn_\b._\bb_\ba_\ba_\br_\bd_\ba_\b@_\bb_\ba_\be_\bs_\by_\bs_\bt_\be_\bm_\bs_\b._\bc_\bo_\bm_\b>
335 time|
336 axis|
337 begin__|00|
338 |01|
339 u|02|----* sample1, restart "hb"-timer
340 u|03| /
341 u|04| /
342 u|05| /
343 u|06|/ "hbt" expired
344 u|07|
345 |08|----* sample2, restart "hb"
346 |09| /
347 |10| /
348 u|11|----* sample3, restart "hb"
349 u|12| /
350 u|13| /
351 step1_u|14| /
352 u|15|/ "swt" expired
353 u|16|
354 |17|----* sample4, restart "hb", create "pdp" for step1 =
355 |18| / = unknown due to 10 "u" labled secs > 0.5 * step
356 |19| /
357 |20| /
358 |21|----* sample5, restart "hb"
359 |22| /
360 |23| /
361 |24|----* sample6, restart "hb"
362 |25| /
363 |26| /
364 |27|----* sample7, restart "hb"
365 step2__|28| /
366 |22| /
367 |23|----* sample8, restart "hb", create "pdp" for step1, create "cdp"
368 |24| /
369 |25| /
371 graphics by _\bv_\bl_\ba_\bd_\bi_\bm_\bi_\br_\b._\bl_\ba_\bv_\br_\bo_\bv_\b@_\bd_\be_\bs_\by_\b._\bd_\be.
374 Here are a few hints on how to measure:
376 Temperature
377 Usually you have some type of meter you can read to get the temper-
378 ature. The temperature is not really connected with a time. The
379 only connection is that the temperature reading happened at a cer-
381 will then record your reading together with the time.
383 Mail Messages
384 Assume you have a method to count the number of messages trans-
385 ported by your mailserver in a certain amount of time, giving you
386 data like '5 messages in the last 65 seconds'. If you look at the
388 with the number 5 and the end time of your monitoring period. RRD-
389 tool will then record the number of messages per second. If at some
390 later stage you want to know the number of messages transported in
391 a day, you can get the average messages per second from RRDtool for
392 the day in question and multiply this number with the number of
393 seconds in a day. Because all math is run with Doubles, the preci-
394 sion should be acceptable.
396 It's always a Rate
397 RRDtool stores rates in amount/second for COUNTER, DERIVE and ABSO-
398 LUTE data. When you plot the data, you will get on the y axis
399 amount/second which you might be tempted to convert to an absolute
400 amount by multiplying by the delta-time between the points. RRDtool
401 plots continuous data, and as such is not appropriate for plotting
402 absolute amounts as for example "total bytes" sent and received in
403 a router. What you probably want is plot rates that you can scale
404 to bytes/hour, for example, or plot absolute amounts with another
405 tool that draws bar-plots, where the delta-time is clear on the
406 plot for each point (such that when you read the graph you see for
407 example GB on the y axis, days on the x axis and one bar for each
408 day).
411 rrdtool create temperature.rrd --step 300 \
412 DS:temp:GAUGE:600:-273:5000 \
413 RRA:AVERAGE:0.5:1:1200 \
414 RRA:MIN:0.5:12:2400 \
415 RRA:MAX:0.5:12:2400 \
416 RRA:AVERAGE:0.5:12:2400
418 This sets up an R\bRR\bRD\bD called _\bt_\be_\bm_\bp_\be_\br_\ba_\bt_\bu_\br_\be_\b._\br_\br_\bd which accepts one tempera-
419 ture value every 300 seconds. If no new data is supplied for more than
420 600 seconds, the temperature becomes _\b*_\bU_\bN_\bK_\bN_\bO_\bW_\bN_\b*. The minimum acceptable
421 value is -273 and the maximum is 5'000.
423 A few archive areas are also defined. The first stores the temperatures
424 supplied for 100 hours (1'200 * 300 seconds = 100 hours). The second
425 RRA stores the minimum temperature recorded over every hour (12 * 300
426 seconds = 1 hour), for 100 days (2'400 hours). The third and the fourth
427 RRA's do the same for the maximum and average temperature, respec-
428 tively.
431 rrdtool create monitor.rrd --step 300 \
432 DS:ifOutOctets:COUNTER:1800:0:4294967295 \
433 RRA:AVERAGE:0.5:1:2016 \
434 RRA:HWPREDICT:1440:0.1:0.0035:288
438 functions R\bRR\bRA\bAs\bs for aberrant behavior detection. Note that the _\br_\br_\ba_\b-_\bn_\bu_\bm
440 created with default parameter values. In this example, the forecasting
441 algorithm baseline adapts quickly; in fact the most recent one hour of
442 observations (each at 5 minute intervals) accounts for 75% of the base-
443 line prediction. The linear trend forecast adapts much more slowly.
444 Observations made during the last day (at 288 observations per day)
445 account for only 65% of the predicted linear trend. Note: these compu-
446 tations rely on an exponential smoothing formula described in the LISA
447 2000 paper.
449 The seasonal cycle is one day (288 data points at 300 second inter-
450 vals), and the seasonal adaption parameter will be set to 0.1. The RRD
451 file will store 5 days (1'440 data points) of forecasts and deviation
452 predictions before wrap around. The file will store 1 day (a seasonal
458 rrdtool create monitor.rrd --step 300 \
459 DS:ifOutOctets:COUNTER:1800:0:4294967295 \
460 RRA:AVERAGE:0.5:1:2016 \
461 RRA:HWPREDICT:1440:0.1:0.0035:288:3 \
462 RRA:SEASONAL:288:0.1:2 \
463 RRA:DEVPREDICT:1440:5 \
464 RRA:DEVSEASONAL:288:0.1:2 \
465 RRA:FAILURES:288:7:9:5
467 Of course, explicit creation need not replicate implicit create, a num-
468 ber of arguments could be changed.
471 rrdtool create proxy.rrd --step 300 \
472 DS:Total:DERIVE:1800:0:U \
473 DS:Duration:DERIVE:1800:0:U \
474 DS:AvgReqDur:COMPUTE:Duration,Requests,0,EQ,1,Requests,IF,/ \
475 RRA:AVERAGE:0.5:1:2016
477 This example is monitoring the average request duration during each 300
478 sec interval for requests processed by a web proxy during the interval.
479 In this case, the proxy exposes two counters, the number of requests
480 processed since boot and the total cumulative duration of all processed
481 requests. Clearly these counters both have some rollover point, but
482 using the DERIVE data source also handles the reset that occurs when
483 the web proxy is stopped and restarted.
486 during the interval. The second data source stores the total duration
487 of all requests processed during the interval divided by 300. The COM-
488 PUTE data source divides each PDP of the AccumDuration by the corre-
489 sponding PDP of TotalRequests and stores the average request duration.
490 The remainder of the RPN expression handles the divide by zero case.
493 Tobias Oetiker <tobi@oetiker.ch>
497 1.2.28 2008-07-23 RRDCREATE(1)