Code

18647ec9b4c7a110b12840e20aff2bd8dbf7a8e7
[pkg-rrdtool.git] / doc / rrdcreate.txt
1 RRDCREATE(1)                        rrdtool                       RRDCREATE(1)
5 N\bNA\bAM\bME\bE
6        rrdcreate - Set up a new Round Robin Database
8 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
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]
12 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
13        The create function of RRDtool lets you set up new Round Robin Database
14        (R\bRR\bRD\bD) files.  The file is created at its final, full size and filled
15        with _\b*_\bU_\bN_\bK_\bN_\bO_\bW_\bN_\b* data.
17        _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
19        The name of the R\bRR\bRD\bD you want to create. R\bRR\bRD\bD files should end with the
20        extension _\b._\br_\br_\bd. However, R\bRR\bRD\bDt\bto\boo\bol\bl will accept any filename.
22        -\b--\b-s\bst\bta\bar\brt\bt|\b|-\b-b\bb _\bs_\bt_\ba_\br_\bt _\bt_\bi_\bm_\be (\b(d\bde\bef\bfa\bau\bul\blt\bt:\b: n\bno\bow\bw -\b- 1\b10\b0s\bs)\b)
24        Specifies the time in seconds since 1970-01-01 UTC when the first value
25        should be added to the R\bRR\bRD\bD. R\bRR\bRD\bDt\bto\boo\bol\bl will not accept any data timed
26        before or at the time specified.
28        See also AT-STYLE TIME SPECIFICATION section in the _\br_\br_\bd_\bf_\be_\bt_\bc_\bh documenta-
29        tion for other ways to specify time.
31        -\b--\b-s\bst\bte\bep\bp|\b|-\b-s\bs _\bs_\bt_\be_\bp (\b(d\bde\bef\bfa\bau\bul\blt\bt:\b: 3\b30\b00\b0 s\bse\bec\bco\bon\bnd\bds\bs)\b)
33        Specifies the base interval in seconds with which data will be fed into
34        the R\bRR\bRD\bD.
36        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
38        A single R\bRR\bRD\bD can accept input from several data sources (D\bDS\bS), for exam-
39        ple incoming and outgoing traffic on a specific communication line.
40        With the D\bDS\bS configuration option you must define some basic properties
41        of each data source you want to store in the R\bRR\bRD\bD.
43        _\bd_\bs_\b-_\bn_\ba_\bm_\be is the name you will use to reference this particular data
44        source from an R\bRR\bRD\bD. A _\bd_\bs_\b-_\bn_\ba_\bm_\be must be 1 to 19 characters long in the
45        characters [a-zA-Z0-9_].
47        _\bD_\bS_\bT defines the Data Source Type. The remaining arguments of a data
48        source entry depend on the data source type. For GAUGE, COUNTER,
49        DERIVE, and ABSOLUTE the format for a data source entry is:
51        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
53        For COMPUTE data sources, the format is:
55        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
57        In order to decide which data source type to use, review the defini-
58        tions that follow. Also consult the section on "HOW TO MEASURE" for
59        further insight.
61        G\bGA\bAU\bUG\bGE\bE
62            is for things like temperatures or number of people in a room or
63            the value of a RedHat share.
65        C\bCO\bOU\bUN\bNT\bTE\bER\bR
66            is for continuous incrementing counters like the ifInOctets counter
67            in a router. The C\bCO\bOU\bUN\bNT\bTE\bER\bR data source assumes that the counter never
68            decreases, except when a counter overflows.  The update function
69            takes the overflow into account.  The counter is stored as a per-
70            second rate. When the counter overflows, RRDtool checks if the
71            overflow happened at the 32bit or 64bit border and acts accordingly
72            by adding an appropriate value to the result.
74        D\bDE\bER\bRI\bIV\bVE\bE
75            will store the derivative of the line going from the last to the
76            current value of the data source. This can be useful for gauges,
77            for example, to measure the rate of people entering or leaving a
78            room. Internally, derive works exactly like COUNTER but without
79            overflow checks. So if your counter does not reset at 32 or 64 bit
80            you might want to use DERIVE and combine it with a MIN value of 0.
82            N\bNO\bOT\bTE\bE o\bon\bn C\bCO\bOU\bUN\bNT\bTE\bER\bR v\bvs\bs D\bDE\bER\bRI\bIV\bVE\bE
84            by Don Baarda <don.baarda@baesystems.com>
86            If you cannot tolerate ever mistaking the occasional counter reset
87            for a legitimate counter wrap, and would prefer "Unknowns" for all
88            legitimate counter wraps and resets, always use DERIVE with min=0.
89            Otherwise, using COUNTER with a suitable max will return correct
90            values for all legitimate counter wraps, mark some counter resets
91            as "Unknown", but can mistake some counter resets for a legitimate
92            counter wrap.
94            For a 5 minute step and 32-bit counter, the probability of mistak-
95            ing a counter reset for a legitimate wrap is arguably about 0.8%
96            per 1Mbps of maximum bandwidth. Note that this equates to 80% for
97            100Mbps interfaces, so for high bandwidth interfaces and a 32bit
98            counter, DERIVE with min=0 is probably preferable. If you are using
99            a 64bit counter, just about any max setting will eliminate the pos-
100            sibility of mistaking a reset for a counter wrap.
102        A\bAB\bBS\bSO\bOL\bLU\bUT\bTE\bE
103            is for counters which get reset upon reading. This is used for fast
104            counters which tend to overflow. So instead of reading them nor-
105            mally you reset them after every read to make sure you have a maxi-
106            mum time available before the next overflow. Another usage is for
107            things you count like number of messages since the last update.
109        C\bCO\bOM\bMP\bPU\bUT\bTE\bE
110            is for storing the result of a formula applied to other data
111            sources in the R\bRR\bRD\bD. This data source is not supplied a value on
112            update, but rather its Primary Data Points (PDPs) are computed from
113            the PDPs of the data sources according to the rpn-expression that
114            defines the formula. Consolidation functions are then applied nor-
115            mally to the PDPs of the COMPUTE data source (that is the rpn-
116            expression is only applied to generate PDPs). In database software,
117            such data sets are referred to as "virtual" or "computed" columns.
119        _\bh_\be_\ba_\br_\bt_\bb_\be_\ba_\bt defines the maximum number of seconds that may pass between
120        two updates of this data source before the value of the data source is
121        assumed to be _\b*_\bU_\bN_\bK_\bN_\bO_\bW_\bN_\b*.
123        _\bm_\bi_\bn and _\bm_\ba_\bx define the expected range values for data supplied by a
124        data source. If _\bm_\bi_\bn and/or _\bm_\ba_\bx any value outside the defined range will
125        be regarded as _\b*_\bU_\bN_\bK_\bN_\bO_\bW_\bN_\b*. If you do not know or care about min and max,
126        set them to U for unknown. Note that min and max always refer to the
127        processed values of the DS. For a traffic-C\bCO\bOU\bUN\bNT\bTE\bER\bR type DS this would be
128        the maximum and minimum data-rate expected from the device.
130        _\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, _\ba_\bl_\bw_\ba_\by_\bs
131        _\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 _\bd_\bo_\bi_\bn_\bg _\ba
132        _\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 _\bu_\bp_\bd_\ba_\bt_\be_\b.
134        _\br_\bp_\bn_\b-_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn defines the formula used to compute the PDPs of a
135        COMPUTE data source from other data sources in the same <RRD>. It is
136        similar to defining a C\bCD\bDE\bEF\bF argument for the graph command. Please refer
137        to that manual page for a list and description of RPN operations sup-
138        ported. For COMPUTE data sources, the following RPN operations are not
139        supported: COUNT, PREV, TIME, and LTIME. In addition, in defining the
140        RPN expression, the COMPUTE data source may only refer to the names of
141        data source listed previously in the create command. This is similar to
142        the restriction that C\bCD\bDE\bEF\bFs must refer only to D\bDE\bEF\bFs and C\bCD\bDE\bEF\bFs previously
143        defined in the same graph command.
145        R\bRR\bRA\bA:\b:_\bC_\bF:\b:_\bc_\bf _\ba_\br_\bg_\bu_\bm_\be_\bn_\bt_\bs
147        The purpose of an R\bRR\bRD\bD is to store data in the round robin archives
148        (R\bRR\bRA\bA). An archive consists of a number of data values or statistics for
149        each of the defined data-sources (D\bDS\bS) and is defined with an R\bRR\bRA\bA line.
151        When data is entered into an R\bRR\bRD\bD, it is first fit into time slots of
152        the length defined with the -\b-s\bs option, thus becoming a _\bp_\br_\bi_\bm_\ba_\br_\by _\bd_\ba_\bt_\ba
153        _\bp_\bo_\bi_\bn_\bt.
155        The data is also processed with the consolidation function (_\bC_\bF) of the
156        archive. There are several consolidation functions that consolidate
157        primary data points via an aggregate function: A\bAV\bVE\bER\bRA\bAG\bGE\bE, M\bMI\bIN\bN, M\bMA\bAX\bX, L\bLA\bAS\bST\bT.
159        AVERAGE
160            the average of the data points is stored.
162        MIN the smallest of the data points is stored.
164        MAX the largest of the data points is stored.
166        LAST
167            the last data points is used.
169        Note that data aggregation inevitably leads to loss of precision and
170        information. The trick is to pick the aggregate function such that the
171        _\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\bi_\bn_\bg properties of your data is kept across the aggregation pro-
172        cess.
174        The format of R\bRR\bRA\bA line for these consolidation functions is:
176        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
178        _\bx_\bf_\bf The xfiles factor defines what part of a consolidation interval may
179        be made up from _\b*_\bU_\bN_\bK_\bN_\bO_\bW_\bN_\b* data while the consolidated value is still
180        regarded as known. It is given as the ratio of allowed _\b*_\bU_\bN_\bK_\bN_\bO_\bW_\bN_\b* PDPs
181        to the number of PDPs in the interval. Thus, it ranges from 0 to 1
182        (exclusive).
184        _\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 build a
185        _\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.
187        _\br_\bo_\bw_\bs defines how many generations of data values are kept in an R\bRR\bRA\bA.
188        Obviously, this has to be greater than zero.
190 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
191        In addition to the aggregate functions, there are a set of specialized
192        functions that enable R\bRR\bRD\bDt\bto\boo\bol\bl to provide data smoothing (via the Holt-
193        Winters forecasting algorithm), confidence bands, and the flagging
194        aberrant behavior in the data source time series:
196        Â·   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]
198        Â·   R\bRR\bRA\bA:\b:_\bM_\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]
200        Â·   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[:\b:s\bsm\bmo\boo\bot\bth\bhi\bin\bng\bg-\b-w\bwi\bin\bnd\bdo\bow\bw=\b=_\bf_\br_\ba_\bc_\b-
201            _\bt_\bi_\bo_\bn]
203        Â·   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[:\b:s\bsm\bmo\boo\bot\bth\bhi\bin\bng\bg-\b-w\bwi\bin\bn-\b-
204            d\bdo\bow\bw=\b=_\bf_\br_\ba_\bc_\bt_\bi_\bo_\bn]
206        Â·   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
208        Â·   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
210        These R\bRR\bRA\bAs\bs differ from the true consolidation functions in several
211        ways.  First, each of the R\bRR\bRA\bAs is updated once for every primary data
212        point.  Second, these R\bRR\bRA\bAs\bs are interdependent. To generate real-time
213        confidence bounds, a matched set of SEASONAL, DEVSEASONAL, DEVPREDICT,
214        and either HWPREDICT or MHWPREDICT must exist. Generating smoothed val-
215        ues of the primary data points requires a SEASONAL R\bRR\bRA\bA and either an
216        HWPREDICT or MHWPREDICT R\bRR\bRA\bA. Aberrant behavior detection requires FAIL-
217        URES, DEVSEASONAL, SEASONAL, and either HWPREDICT or MHWPREDICT.
219        The predicted, or smoothed, values are stored in the HWPREDICT or MHW-
220        PREDICT R\bRR\bRA\bA. HWPREDICT and MHWPREDICT are actually two variations on
221        the Holt-Winters method. They are interchangeable. Both attempt to
222        decompose data into three components: a baseline, a trend, and a sea-
223        sonal coefficient.  HWPREDICT adds its seasonal coefficient to the
224        baseline to form a prediction, whereas MHWPREDICT multiplies its sea-
225        sonal coefficient by the baseline to form a prediction. The difference
226        is noticeable when the baseline changes significantly in the course of
227        a season; HWPREDICT will predict the seasonality to stay constant as
228        the baseline changes, but MHWPREDICT will predict the seasonality to
229        grow or shrink in proportion to the baseline. The proper choice of
230        method depends on the thing being modeled. For simplicity, the rest of
231        this discussion will refer to HWPREDICT, but MHWPREDICT may be substi-
232        tuted in its place.
234        The predicted deviations are stored in DEVPREDICT (think a standard
235        deviation which can be scaled to yield a confidence band). The FAILURES
236        R\bRR\bRA\bA stores binary indicators. A 1 marks the indexed observation as
237        failure; that is, the number of confidence bounds violations in the
238        preceding window of observations met or exceeded a specified threshold.
239        An example of using these R\bRR\bRA\bAs\bs to graph confidence bounds and failures
240        appears in rrdgraph.
242        The SEASONAL and DEVSEASONAL R\bRR\bRA\bAs\bs store the seasonal coefficients for
243        the Holt-Winters forecasting algorithm and the seasonal deviations,
244        respectively.  There is one entry per observation time point in the
245        seasonal cycle. For example, if primary data points are generated every
246        five minutes and the seasonal cycle is 1 day, both SEASONAL and DEVSEA-
247        SONAL will have 288 rows.
249        In order to simplify the creation for the novice user, in addition to
250        supporting explicit creation of the HWPREDICT, SEASONAL, DEVPREDICT,
251        DEVSEASONAL, and FAILURES R\bRR\bRA\bAs\bs, the R\bRR\bRD\bDt\bto\boo\bol\bl create command supports
252        implicit creation of the other four when HWPREDICT is specified alone
253        and the final argument _\br_\br_\ba_\b-_\bn_\bu_\bm is omitted.
255        _\br_\bo_\bw_\bs specifies the length of the R\bRR\bRA\bA prior to wrap around. Remember
256        that there is a one-to-one correspondence between primary data points
257        and entries in these RRAs. For the HWPREDICT CF, _\br_\bo_\bw_\bs should be larger
258        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,
259        the default number of rows is the same as the HWPREDICT _\br_\bo_\bw_\bs argument.
260        If the FAILURES R\bRR\bRA\bA is implicitly created, _\br_\bo_\bw_\bs will be set to the _\bs_\be_\ba_\b-
261        _\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
262        _\br_\be_\bs_\bi_\bz_\be command is available if these defaults are not sufficient and
263        the creator wishes to avoid explicit creations of the other specialized
264        function R\bRR\bRA\bAs\bs.
266        _\bs_\be_\ba_\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd specifies the number of primary data points in a sea-
267        sonal cycle. If SEASONAL and DEVSEASONAL are implicitly created, this
268        argument for those R\bRR\bRA\bAs\bs is set automatically to the value specified by
269        HWPREDICT. If they are explicitly created, the creator should verify
270        that all three _\bs_\be_\ba_\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd arguments agree.
272        _\ba_\bl_\bp_\bh_\ba is the adaption parameter of the intercept (or baseline) coeffi-
273        cient in the Holt-Winters forecasting algorithm. See rrdtool for a
274        description of this algorithm. _\ba_\bl_\bp_\bh_\ba must lie between 0 and 1. A value
275        closer to 1 means that more recent observations carry greater weight in
276        predicting the baseline component of the forecast. A value closer to 0
277        means that past history carries greater weight in predicting the base-
278        line component.
280        _\bb_\be_\bt_\ba is the adaption parameter of the slope (or linear trend) coeffi-
281        cient in the Holt-Winters forecasting algorithm. _\bb_\be_\bt_\ba must lie between
282        0 and 1 and plays the same role as _\ba_\bl_\bp_\bh_\ba with respect to the predicted
283        linear trend.
285        _\bg_\ba_\bm_\bm_\ba is the adaption parameter of the seasonal coefficients in the
286        Holt-Winters forecasting algorithm (HWPREDICT) or the adaption parame-
287        ter in the exponential smoothing update of the seasonal deviations. It
288        must lie between 0 and 1. If the SEASONAL and DEVSEASONAL R\bRR\bRA\bAs\bs are cre-
289        ated implicitly, they will both have the same value for _\bg_\ba_\bm_\bm_\ba: the
290        value specified for the HWPREDICT _\ba_\bl_\bp_\bh_\ba argument. Note that because
291        there is one seasonal coefficient (or deviation) for each time point
292        during the seasonal cycle, the adaptation rate is much slower than the
293        baseline. Each seasonal coefficient is only updated (or adapts) when
294        the observed value occurs at the offset in the seasonal cycle corre-
295        sponding to that coefficient.
297        If SEASONAL and DEVSEASONAL R\bRR\bRA\bAs\bs are created explicitly, _\bg_\ba_\bm_\bm_\ba need not
298        be the same for both. Note that _\bg_\ba_\bm_\bm_\ba can also be changed via the R\bRR\bRD\bD-\b-
299        t\bto\boo\bol\bl _\bt_\bu_\bn_\be command.
301        _\bs_\bm_\bo_\bo_\bt_\bh_\bi_\bn_\bg_\b-_\bw_\bi_\bn_\bd_\bo_\bw specifies the fraction of a season that should be
302        averaged around each point. By default, the value of _\bs_\bm_\bo_\bo_\bt_\bh_\bi_\bn_\bg_\b-_\bw_\bi_\bn_\bd_\bo_\bw
303        is 0.05, which means each value in SEASONAL and DEVSEASONAL will be
304        occasionally replaced by averaging it with its (_\bs_\be_\ba_\bs_\bo_\bn_\ba_\bl _\bp_\be_\br_\bi_\bo_\bd*0.05)
305        nearest neighbors.  Setting _\bs_\bm_\bo_\bo_\bt_\bh_\bi_\bn_\bg_\b-_\bw_\bi_\bn_\bd_\bo_\bw to zero will disable the
306        running-average smoother altogether.
308        _\br_\br_\ba_\b-_\bn_\bu_\bm provides the links between related R\bRR\bRA\bAs\bs. If HWPREDICT is speci-
309        fied alone and the other R\bRR\bRA\bAs\bs are created implicitly, then there is no
310        need to worry about this argument. If R\bRR\bRA\bAs\bs are created explicitly, then
311        carefully pay attention to this argument. For each R\bRR\bRA\bA which includes
312        this argument, there is a dependency between that R\bRR\bRA\bA and another R\bRR\bRA\bA.
313        The _\br_\br_\ba_\b-_\bn_\bu_\bm argument is the 1-based index in the order of R\bRR\bRA\bA creation
314        (that is, the order they appear in the _\bc_\br_\be_\ba_\bt_\be command). The dependent
315        R\bRR\bRA\bA for each R\bRR\bRA\bA requiring the _\br_\br_\ba_\b-_\bn_\bu_\bm argument is listed here:
317        Â·   HWPREDICT _\br_\br_\ba_\b-_\bn_\bu_\bm is the index of the SEASONAL R\bRR\bRA\bA.
319        Â·   SEASONAL _\br_\br_\ba_\b-_\bn_\bu_\bm is the index of the HWPREDICT R\bRR\bRA\bA.
321        Â·   DEVPREDICT _\br_\br_\ba_\b-_\bn_\bu_\bm is the index of the DEVSEASONAL R\bRR\bRA\bA.
323        Â·   DEVSEASONAL _\br_\br_\ba_\b-_\bn_\bu_\bm is the index of the HWPREDICT R\bRR\bRA\bA.
325        Â·   FAILURES _\br_\br_\ba_\b-_\bn_\bu_\bm is the index of the DEVSEASONAL R\bRR\bRA\bA.
327        _\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd is the minimum number of violations (observed values outside
328        the confidence bounds) within a window that constitutes a failure. If
329        the FAILURES R\bRR\bRA\bA is implicitly created, the default value is 7.
331        _\bw_\bi_\bn_\bd_\bo_\bw _\bl_\be_\bn_\bg_\bt_\bh is the number of time points in the window. Specify an
332        integer greater than or equal to the threshold and less than or equal
333        to 28.  The time interval this window represents depends on the inter-
334        val between primary data points. If the FAILURES R\bRR\bRA\bA is implicitly cre-
335        ated, the default value is 9.
337 T\bTh\bhe\be H\bHE\bEA\bAR\bRT\bTB\bBE\bEA\bAT\bT a\ban\bnd\bd t\bth\bhe\be S\bST\bTE\bEP\bP
338        Here is an explanation by Don Baarda on the inner workings of RRDtool.
339        It may help you to sort out why all this *UNKNOWN* data is popping up
340        in your databases:
342        RRDtool gets fed samples/updates at arbitrary times. From these it
343        builds Primary Data Points (PDPs) on every "step" interval. The PDPs
344        are then accumulated into the RRAs.
346        The "heartbeat" defines the maximum acceptable interval between sam-
347        ples/updates. If the interval between samples is less than "heartbeat",
348        then an average rate is calculated and applied for that interval. If
349        the interval between samples is longer than "heartbeat", then that
350        entire interval is considered "unknown". Note that there are other
351        things that can make a sample interval "unknown", such as the rate
352        exceeding limits, or a sample that was explicitly marked as unknown.
354        The known rates during a PDP's "step" interval are used to calculate an
355        average rate for that PDP. If the total "unknown" time accounts for
356        more than h\bha\bal\blf\bf the "step", the entire PDP is marked as "unknown". This
357        means that a mixture of known and "unknown" sample times in a single
358        PDP "step" may or may not add up to enough "known" time to warrent for
359        a known PDP.
361        The "heartbeat" can be short (unusual) or long (typical) relative to
362        the "step" interval between PDPs. A short "heartbeat" means you require
363        multiple samples per PDP, and if you don't get them mark the PDP
364        unknown. A long heartbeat can span multiple "steps", which means it is
365        acceptable to have multiple PDPs calculated from a single sample. An
366        extreme example of this might be a "step" of 5 minutes and a "heart-
367        beat" of one day, in which case a single sample every day will result
368        in all the PDPs for that entire day period being set to the same aver-
369        age 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>
371               time|
372               axis|
373         begin__|00|
374                |01|
375               u|02|----* sample1, restart "hb"-timer
376               u|03|   /
377               u|04|  /
378               u|05| /
379               u|06|/     "hbt" expired
380               u|07|
381                |08|----* sample2, restart "hb"
382                |09|   /
383                |10|  /
384               u|11|----* sample3, restart "hb"
385               u|12|   /
386               u|13|  /
387         step1_u|14| /
388               u|15|/     "swt" expired
389               u|16|
390                |17|----* sample4, restart "hb", create "pdp" for step1 =
391                |18|   /  = unknown due to 10 "u" labled secs > 0.5 * step
392                |19|  /
393                |20| /
394                |21|----* sample5, restart "hb"
395                |22|   /
396                |23|  /
397                |24|----* sample6, restart "hb"
398                |25|   /
399                |26|  /
400                |27|----* sample7, restart "hb"
401         step2__|28|   /
402                |22|  /
403                |23|----* sample8, restart "hb", create "pdp" for step1, create "cdp"
404                |24|   /
405                |25|  /
407        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.
409 H\bHO\bOW\bW T\bTO\bO M\bME\bEA\bAS\bSU\bUR\bRE\bE
410        Here are a few hints on how to measure:
412        Temperature
413            Usually you have some type of meter you can read to get the temper-
414            ature.  The temperature is not really connected with a time. The
415            only connection is that the temperature reading happened at a cer-
416            tain time. You can use the G\bGA\bAU\bUG\bGE\bE data source type for this. RRDtool
417            will then record your reading together with the time.
419        Mail Messages
420            Assume you have a method to count the number of messages trans-
421            ported by your mailserver in a certain amount of time, giving you
422            data like '5 messages in the last 65 seconds'. If you look at the
423            count of 5 like an A\bAB\bBS\bSO\bOL\bLU\bUT\bTE\bE data type you can simply update the RRD
424            with the number 5 and the end time of your monitoring period. RRD-
425            tool will then record the number of messages per second. If at some
426            later stage you want to know the number of messages transported in
427            a day, you can get the average messages per second from RRDtool for
428            the day in question and multiply this number with the number of
429            seconds in a day. Because all math is run with Doubles, the preci-
430            sion should be acceptable.
432        It's always a Rate
433            RRDtool stores rates in amount/second for COUNTER, DERIVE and ABSO-
434            LUTE data.  When you plot the data, you will get on the y axis
435            amount/second which you might be tempted to convert to an absolute
436            amount by multiplying by the delta-time between the points. RRDtool
437            plots continuous data, and as such is not appropriate for plotting
438            absolute amounts as for example "total bytes" sent and received in
439            a router. What you probably want is plot rates that you can scale
440            to bytes/hour, for example, or plot absolute amounts with another
441            tool that draws bar-plots, where the delta-time is clear on the
442            plot for each point (such that when you read the graph you see for
443            example GB on the y axis, days on the x axis and one bar for each
444            day).
446 E\bEX\bXA\bAM\bMP\bPL\bLE\bE
447         rrdtool create temperature.rrd --step 300 \
448          DS:temp:GAUGE:600:-273:5000 \
449          RRA:AVERAGE:0.5:1:1200 \
450          RRA:MIN:0.5:12:2400 \
451          RRA:MAX:0.5:12:2400 \
452          RRA:AVERAGE:0.5:12:2400
454        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-
455        ture value every 300 seconds. If no new data is supplied for more than
456        600 seconds, the temperature becomes _\b*_\bU_\bN_\bK_\bN_\bO_\bW_\bN_\b*.  The minimum acceptable
457        value is -273 and the maximum is 5'000.
459        A few archive areas are also defined. The first stores the temperatures
460        supplied for 100 hours (1'200 * 300 seconds = 100 hours). The second
461        RRA stores the minimum temperature recorded over every hour (12 * 300
462        seconds = 1 hour), for 100 days (2'400 hours). The third and the fourth
463        RRA's do the same for the maximum and average temperature, respec-
464        tively.
466 E\bEX\bXA\bAM\bMP\bPL\bLE\bE 2\b2
467         rrdtool create monitor.rrd --step 300        \
468           DS:ifOutOctets:COUNTER:1800:0:4294967295   \
469           RRA:AVERAGE:0.5:1:2016                     \
470           RRA:HWPREDICT:1440:0.1:0.0035:288
472        This example is a monitor of a router interface. The first R\bRR\bRA\bA tracks
473        the traffic flow in octets; the second R\bRR\bRA\bA generates the specialized
474        functions R\bRR\bRA\bAs\bs for aberrant behavior detection. Note that the _\br_\br_\ba_\b-_\bn_\bu_\bm
475        argument of HWPREDICT is missing, so the other R\bRR\bRA\bAs\bs will implicitly be
476        created with default parameter values. In this example, the forecasting
477        algorithm baseline adapts quickly; in fact the most recent one hour of
478        observations (each at 5 minute intervals) accounts for 75% of the base-
479        line prediction. The linear trend forecast adapts much more slowly.
480        Observations made during the last day (at 288 observations per day)
481        account for only 65% of the predicted linear trend. Note: these compu-
482        tations rely on an exponential smoothing formula described in the LISA
483        2000 paper.
485        The seasonal cycle is one day (288 data points at 300 second inter-
486        vals), and the seasonal adaption parameter will be set to 0.1. The RRD
487        file will store 5 days (1'440 data points) of forecasts and deviation
488        predictions before wrap around. The file will store 1 day (a seasonal
489        cycle) of 0-1 indicators in the FAILURES R\bRR\bRA\bA.
491        The same RRD file and R\bRR\bRA\bAs\bs are created with the following command,
492        which explicitly creates all specialized function R\bRR\bRA\bAs\bs.
494         rrdtool create monitor.rrd --step 300 \
495           DS:ifOutOctets:COUNTER:1800:0:4294967295 \
496           RRA:AVERAGE:0.5:1:2016 \
497           RRA:HWPREDICT:1440:0.1:0.0035:288:3 \
498           RRA:SEASONAL:288:0.1:2 \
499           RRA:DEVPREDICT:1440:5 \
500           RRA:DEVSEASONAL:288:0.1:2 \
501           RRA:FAILURES:288:7:9:5
503        Of course, explicit creation need not replicate implicit create, a num-
504        ber of arguments could be changed.
506 E\bEX\bXA\bAM\bMP\bPL\bLE\bE 3\b3
507         rrdtool create proxy.rrd --step 300 \
508           DS:Total:DERIVE:1800:0:U  \
509           DS:Duration:DERIVE:1800:0:U  \
510           DS:AvgReqDur:COMPUTE:Duration,Requests,0,EQ,1,Requests,IF,/ \
511           RRA:AVERAGE:0.5:1:2016
513        This example is monitoring the average request duration during each 300
514        sec interval for requests processed by a web proxy during the interval.
515        In this case, the proxy exposes two counters, the number of requests
516        processed since boot and the total cumulative duration of all processed
517        requests. Clearly these counters both have some rollover point, but
518        using the DERIVE data source also handles the reset that occurs when
519        the web proxy is stopped and restarted.
521        In the R\bRR\bRD\bD, the first data source stores the requests per second rate
522        during the interval. The second data source stores the total duration
523        of all requests processed during the interval divided by 300. The COM-
524        PUTE data source divides each PDP of the AccumDuration by the corre-
525        sponding PDP of TotalRequests and stores the average request duration.
526        The remainder of the RPN expression handles the divide by zero case.
528 A\bAU\bUT\bTH\bHO\bOR\bR
529        Tobias Oetiker <tobi@oetiker.ch>
533 1.3.99909060808                   2008-06-11                      RRDCREATE(1)