.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "RRDCREATE 1" .TH RRDCREATE 1 "2024-07-29" "1.9.0" "rrdtool" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" rrdcreate \- Set up a new Round Robin Database .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBrrdtool\fR \fBcreate\fR \fIfilename\fR [\fB\-\-start\fR|\fB\-b\fR\ \fIstart\ time\fR] [\fB\-\-step\fR|\fB\-s\fR\ \fIstep\fR] [\fB\-\-template\fR|\fB\-t\fR\ \fItemplate-file\fR] [\fB\-\-source\fR|\fB\-r\fR\ \fIsource-file\fR] [\fB\-\-no\-overwrite\fR|\fB\-O\fR] [\fB\-\-daemon\fR|\fB\-d\fR\ \fIaddress\fR] [\fB\s-1DS:\s0\fR\fIds-name\fR[\fB=\fR\fImapped-ds-name\fR[\fB[\fR\fIsource-index\fR\fB]\fR]]\fB:\fR\fI\s-1DST\s0\fR\fB:\fR\fIdst\ arguments\fR] [\fB\s-1RRA:\s0\fR\fI\s-1CF\s0\fR\fB:\fR\fIcf\ arguments\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" The create function of RRDtool lets you set up new Round Robin Database (\fB\s-1RRD\s0\fR) files. The file is created at its final, full size and filled with \fI*UNKNOWN*\fR data, unless one or more source \fB\s-1RRD\s0\fR files have been specified and they hold suitable data to \*(L"pre-fill\*(R" the new \fB\s-1RRD\s0\fR file. .SS "\fIfilename\fP" .IX Subsection "filename" The name of the \fB\s-1RRD\s0\fR you want to create. \fB\s-1RRD\s0\fR files should end with the extension \fI.rrd\fR. However, \fBRRDtool\fR will accept any filename. .SS "\fB\-\-start\fP|\fB\-b\fP \fIstart time\fP (default: now \- 10s)" .IX Subsection "--start|-b start time (default: now - 10s)" Specifies the time in seconds since 1970\-01\-01 \s-1UTC\s0 when the first value should be added to the \fB\s-1RRD\s0\fR. \fBRRDtool\fR will not accept any data timed before or at the time specified. .PP See also \*(L"AT-STYLE \s-1TIME SPECIFICATION\*(R"\s0 in rrdfetch for other ways to specify time. .PP If one or more source files is used to pre-fill the new \fB\s-1RRD\s0\fR, the \fB\-\-start\fR option may be omitted. In that case, the latest update time among all source files will be used as the last update time of the new \fB\s-1RRD\s0\fR file, effectively setting the start time. .SS "\fB\-\-step\fP|\fB\-s\fP \fIstep\fP (default: 300 seconds)" .IX Subsection "--step|-s step (default: 300 seconds)" Specifies the base interval in seconds with which data will be fed into the \fB\s-1RRD\s0\fR. A scaling factor may be present as a suffix to the integer; see \&\*(L"\s-1STEP, HEARTBEAT,\s0 and Rows As Durations\*(R". .SS "\fB\-\-no\-overwrite\fP|\fB\-O\fP" .IX Subsection "--no-overwrite|-O" Do not clobber an existing file of the same name. .SS "\fB\-\-daemon\fP|\fB\-d\fP \fIaddress\fP" .IX Subsection "--daemon|-d address" Address of the rrdcached daemon. For a list of accepted formats, see the \fB\-l\fR option in the rrdcached manual. .PP .Vb 1 \& rrdtool create \-\-daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd I .Ve .SS "[\fB\-\-template\fP|\fB\-t\fP\ \fItemplate-file\fP]" .IX Subsection "[--template|-ttemplate-file]" Specifies a template \fB\s-1RRD\s0\fR file to take step, \s-1DS\s0 and \s-1RRA\s0 definitions from. This allows one to base the structure of a new file on some existing file. The data of the template file is \s-1NOT\s0 used for pre-filling, but it is possible to specify the same file as a source file (see below). .PP Additional \s-1DS\s0 and \s-1RRA\s0 definitions are permitted, and will be added to those taken from the template. .SS "\fB\-\-source\fP|\fB\-r\fP \fIsource-file\fP" .IX Subsection "--source|-r source-file" One or more source \fB\s-1RRD\s0\fR files may be named on the command line. Data from these source files will be used to prefill the created \fB\s-1RRD\s0\fR file. The output file and one source file may refer to the same file name. This will effectively replace the source file with the new \fB\s-1RRD\s0\fR file. While there is the danger to loose the source file because it gets replaced, there is no danger that the source and the new file may be \&\*(L"garbled\*(R" together at any point in time, because the new file will always be created as a temporary file first and will only be moved to its final destination once it has been written in its entirety. .PP Prefilling is done by matching up \s-1DS\s0 names, RRAs and consolidation functions and choosing the best available data resolution when doing so. Prefilling may not be mathematically correct in all cases (e.g. if resolutions have to change due to changed stepping of the target \s-1RRD\s0 and old and new resolutions do not match up with old/new bin boundaries in RRAs). .PP In other words: A best effort is made to preserve data during prefilling. Also, pre-filling of RRAs may only be possible for certain kinds of \s-1DS\s0 types. Prefilling may also have strange effects on Holt-Winters forecasting RRAs. In other words: there is no guarantee for data-correctness. .PP When \*(L"pre-filling\*(R" a \fB\s-1RRD\s0\fR file, the structure of the new file must be specified as usual using \s-1DS\s0 and \s-1RRA\s0 specifications as outlined below. Data will be taken from source files based on \s-1DS\s0 names and types and in the order the source files are specified in. Data sources with the same name from different source files will be combined to form a new data source. Generally, for any point in time the new \fB\s-1RRD\s0\fR file will cover after its creation, data from only one source file will have been used for pre-filling. However, data from multiple sources may be combined if it refers to different times or an earlier named source file holds unknown data for a time where a later one holds known data. .PP If this automatic data selection is not desired, the \s-1DS\s0 syntax allows one to specify a mapping of target and source data sources for prefilling. This syntax allows one to rename data sources and to restrict prefilling for a \s-1DS\s0 to only use data from a single source file. .PP Prefilling currently only works reliably for RRAs using one of the classic consolidation functions, that is one of: \s-1AVERAGE, MIN, MAX, LAST.\s0 It might also currently have problems with \s-1COMPUTE\s0 data sources. .PP Note that the act of prefilling during \fBcreate\fR is similar to a lot of the operations available via the \fBtune\fR command, but using \fBcreate\fR syntax. .SS "\fB\s-1DS:\s0\fP\fIds-name\fP[\fB=\fP\fImapped-ds-name\fP[\fB[\fP\fIsource-index\fP\fB]\fP]]\fB:\fP\fI\s-1DST\s0\fP\fB:\fP\fIdst arguments\fP" .IX Subsection "DS:ds-name[=mapped-ds-name[[source-index]]]:DST:dst arguments" A single \fB\s-1RRD\s0\fR can accept input from several data sources (\fB\s-1DS\s0\fR), for example incoming and outgoing traffic on a specific communication line. With the \fB\s-1DS\s0\fR configuration option you must define some basic properties of each data source you want to store in the \fB\s-1RRD\s0\fR. .PP \&\fIds-name\fR is the name you will use to reference this particular data source from an \fB\s-1RRD\s0\fR. A \fIds-name\fR must be 1 to 19 characters long in the characters [a\-zA\-Z0\-9_]. .PP \&\fI\s-1DST\s0\fR defines the Data Source Type. The remaining arguments of a data source entry depend on the data source type. For \s-1GAUGE, COUNTER, DERIVE, DCOUNTER, DDERIVE\s0 and \s-1ABSOLUTE\s0 the format for a data source entry is: .PP \&\fB\s-1DS:\s0\fR\fIds-name\fR\fB:\fR{\fI\s-1GAUGE\s0 | \s-1COUNTER\s0 | \s-1DERIVE\s0 | \s-1DCOUNTER\s0 | \s-1DDERIVE\s0 | \s-1ABSOLUTE\s0\fR}\fB:\fR\fIheartbeat\fR\fB:\fR\fImin\fR\fB:\fR\fImax\fR .PP For \s-1COMPUTE\s0 data sources, the format is: .PP \&\fB\s-1DS:\s0\fR\fIds-name\fR\fB:\fR\fI\s-1COMPUTE\s0\fR\fB:\fR\fIrpn-expression\fR .PP In order to decide which data source type to use, review the definitions that follow. Also consult the section on \*(L"\s-1HOW TO MEASURE\*(R"\s0 for further insight. .IP "\fB\s-1GAUGE\s0\fR" 4 .IX Item "GAUGE" is for things like temperatures or number of people in a room or the value of a RedHat share. .IP "\fB\s-1COUNTER\s0\fR" 4 .IX Item "COUNTER" is for continuous incrementing counters like the ifInOctets counter in a router. The \fB\s-1COUNTER\s0\fR data source assumes that the counter never decreases, except when a counter overflows. The update function takes the overflow into account. The counter is stored as a per-second rate. When the counter overflows, RRDtool checks if the overflow happened at the 32bit or 64bit border and acts accordingly by adding an appropriate value to the result. .IP "\fB\s-1DCOUNTER\s0\fR" 4 .IX Item "DCOUNTER" the same as \fB\s-1COUNTER\s0\fR, but for quantities expressed as double-precision floating point number. Could be used to track quantities that increment by non-integer numbers, i.e. number of seconds that some routine has taken to run, total weight processed by some technology equipment etc. The only substantial difference is that \fB\s-1DCOUNTER\s0\fR can either be upward counting or downward counting, but not both at the same time. The current direction is detected automatically on the second non-undefined counter update and any further change in the direction is considered a reset. The new direction is determined and locked in by the second update after reset and its difference to the value at reset. .IP "\fB\s-1DERIVE\s0\fR" 4 .IX Item "DERIVE" will store the derivative of the line going from the last to the current value of the data source. This can be useful for gauges, for example, to measure the rate of people entering or leaving a room. Internally, derive works exactly like \s-1COUNTER\s0 but without overflow checks. So if your counter does not reset at 32 or 64 bit you might want to use \s-1DERIVE\s0 and combine it with a \s-1MIN\s0 value of 0. .IP "\fB\s-1DDERIVE\s0\fR" 4 .IX Item "DDERIVE" the same as \fB\s-1DERIVE\s0\fR, but for quantities expressed as double-precision floating point number. .Sp \&\fB\s-1NOTE\s0 on \s-1COUNTER\s0 vs \s-1DERIVE\s0\fR .Sp by Don Baarda .Sp If you cannot tolerate ever mistaking the occasional counter reset for a legitimate counter wrap, and would prefer \*(L"Unknowns\*(R" for all legitimate counter wraps and resets, always use \s-1DERIVE\s0 with min=0. Otherwise, using \&\s-1COUNTER\s0 with a suitable max will return correct values for all legitimate counter wraps, mark some counter resets as \*(L"Unknown\*(R", but can mistake some counter resets for a legitimate counter wrap. .Sp For a 5 minute step and 32\-bit counter, the probability of mistaking a counter reset for a legitimate wrap is arguably about 0.8% per 1Mbps of maximum bandwidth. Note that this equates to 80% for 100Mbps interfaces, so for high bandwidth interfaces and a 32bit counter, \s-1DERIVE\s0 with min=0 is probably preferable. If you are using a 64bit counter, just about any max setting will eliminate the possibility of mistaking a reset for a counter wrap. .IP "\fB\s-1ABSOLUTE\s0\fR" 4 .IX Item "ABSOLUTE" is for counters which get reset upon reading. This is used for fast counters which tend to overflow. So instead of reading them normally you reset them after every read to make sure you have a maximum time available before the next overflow. Another usage is for things you count like number of messages since the last update. .IP "\fB\s-1COMPUTE\s0\fR" 4 .IX Item "COMPUTE" is for storing the result of a formula applied to other data sources in the \fB\s-1RRD\s0\fR. This data source is not supplied a value on update, but rather its Primary Data Points (PDPs) are computed from the PDPs of the data sources according to the rpn-expression that defines the formula. Consolidation functions are then applied normally to the PDPs of the \s-1COMPUTE\s0 data source (that is the rpn-expression is only applied to generate PDPs). In database software, such data sets are referred to as \*(L"virtual\*(R" or \*(L"computed\*(R" columns. .PP \&\fIheartbeat\fR defines the maximum number of seconds that may pass between two updates of this data source before the value of the data source is assumed to be \fI*UNKNOWN*\fR. .PP \&\fImin\fR and \fImax\fR define the expected range values for data supplied by a data source. If \fImin\fR and/or \fImax\fR are specified any value outside the defined range will be regarded as \fI*UNKNOWN*\fR. If you do not know or care about min and max, set them to U for unknown. Note that min and max always refer to the processed values of the \s-1DS.\s0 For a traffic\-\fB\s-1COUNTER\s0\fR type \s-1DS\s0 this would be the maximum and minimum data-rate expected from the device. .PP \&\fIIf information on minimal/maximal expected values is available, always set the min and/or max properties. This will help RRDtool in doing a simple sanity check on the data supplied when running update.\fR .PP \&\fIrpn-expression\fR defines the formula used to compute the PDPs of a \&\s-1COMPUTE\s0 data source from other data sources in the same <\s-1RRD\s0>. It is similar to defining a \fB\s-1CDEF\s0\fR argument for the graph command. Please refer to that manual page for a list and description of \s-1RPN\s0 operations supported. For \s-1COMPUTE\s0 data sources, the following \s-1RPN\s0 operations are not supported: \s-1COUNT, PREV, TIME,\s0 and \s-1LTIME.\s0 In addition, in defining the \s-1RPN\s0 expression, the \s-1COMPUTE\s0 data source may only refer to the names of data source listed previously in the create command. This is similar to the restriction that \fB\s-1CDEF\s0\fRs must refer only to \fB\s-1DEF\s0\fRs and \fB\s-1CDEF\s0\fRs previously defined in the same graph command. .PP When pre-filling the new \fB\s-1RRD\s0\fR file using one or more source \fB\s-1RRD\s0\fRs, the \s-1DS\s0 specification may hold an optional mapping after the \s-1DS\s0 name. This takes the form of an equal sign followed by a mapped-to \s-1DS\s0 name and an optional source index enclosed in square brackets. .PP For example, the \s-1DS\s0 .PP .Vb 1 \& DS:a=b[2]:GAUGE:120:0:U .Ve .PP specifies that the \s-1DS\s0 named \fIa\fR should be pre-filled from the \s-1DS\s0 named \fIb\fR in the second listed source file (source indices are 1\-based). .SS "\fB\s-1RRA:\s0\fP\fI\s-1CF\s0\fP\fB:\fP\fIcf arguments\fP" .IX Subsection "RRA:CF:cf arguments" The purpose of an \fB\s-1RRD\s0\fR is to store data in the round robin archives (\fB\s-1RRA\s0\fR). An archive consists of a number of data values or statistics for each of the defined data-sources (\fB\s-1DS\s0\fR) and is defined with an \fB\s-1RRA\s0\fR line. .PP When data is entered into an \fB\s-1RRD\s0\fR, it is first fit into time slots of the length defined with the \fB\-s\fR option, thus becoming a \fIprimary data point\fR. .PP The data is also processed with the consolidation function (\fI\s-1CF\s0\fR) of the archive. There are several consolidation functions that consolidate primary data points via an aggregate function: \fB\s-1AVERAGE\s0\fR, \&\fB\s-1MIN\s0\fR, \fB\s-1MAX\s0\fR, \fB\s-1LAST\s0\fR. .IP "\s-1AVERAGE\s0" 4 .IX Item "AVERAGE" the average of the data points is stored. .IP "\s-1MIN\s0" 4 .IX Item "MIN" the smallest of the data points is stored. .IP "\s-1MAX\s0" 4 .IX Item "MAX" the largest of the data points is stored. .IP "\s-1LAST\s0" 4 .IX Item "LAST" the last data points is used. .PP Note that data aggregation inevitably leads to loss of precision and information. The trick is to pick the aggregate function such that the \&\fIinteresting\fR properties of your data is kept across the aggregation process. .PP The format of \fB\s-1RRA\s0\fR line for these consolidation functions is: .PP \&\fB\s-1RRA:\s0\fR{\fI\s-1AVERAGE\s0 | \s-1MIN\s0 | \s-1MAX\s0 | \s-1LAST\s0\fR}\fB:\fR\fIxff\fR\fB:\fR\fIsteps\fR\fB:\fR\fIrows\fR .PP \&\fIxff\fR The xfiles factor defines what part of a consolidation interval may be made up from \fI*UNKNOWN*\fR data while the consolidated value is still regarded as known. It is given as the ratio of allowed \fI*UNKNOWN*\fR PDPs to the number of PDPs in the interval. Thus, it ranges from 0 to 1 (exclusive). .PP \&\fIsteps\fR defines how many of these \fIprimary data points\fR are used to build a \fIconsolidated data point\fR which then goes into the archive. See also \*(L"\s-1STEP, HEARTBEAT,\s0 and Rows As Durations\*(R". .PP \&\fIrows\fR defines how many generations of data values are kept in an \fB\s-1RRA\s0\fR. Obviously, this has to be greater than zero. See also \*(L"\s-1STEP, HEARTBEAT,\s0 and Rows As Durations\*(R". .SH "Aberrant Behavior Detection with Holt-Winters Forecasting" .IX Header "Aberrant Behavior Detection with Holt-Winters Forecasting" In addition to the aggregate functions, there are a set of specialized functions that enable \fBRRDtool\fR to provide data smoothing (via the Holt-Winters forecasting algorithm), confidence bands, and the flagging aberrant behavior in the data source time series: .IP "\(bu" 4 \&\fB\s-1RRA:\s0\fR\fI\s-1HWPREDICT\s0\fR\fB:\fR\fIrows\fR\fB:\fR\fIalpha\fR\fB:\fR\fIbeta\fR\fB:\fR\fIseasonal period\fR[\fB:\fR\fIrra-num\fR] .IP "\(bu" 4 \&\fB\s-1RRA:\s0\fR\fI\s-1MHWPREDICT\s0\fR\fB:\fR\fIrows\fR\fB:\fR\fIalpha\fR\fB:\fR\fIbeta\fR\fB:\fR\fIseasonal period\fR[\fB:\fR\fIrra-num\fR] .IP "\(bu" 4 \&\fB\s-1RRA:\s0\fR\fI\s-1SEASONAL\s0\fR\fB:\fR\fIseasonal period\fR\fB:\fR\fIgamma\fR\fB:\fR\fIrra-num\fR[\fB:smoothing\-window=\fR\fIfraction\fR] .IP "\(bu" 4 \&\fB\s-1RRA:\s0\fR\fI\s-1DEVSEASONAL\s0\fR\fB:\fR\fIseasonal period\fR\fB:\fR\fIgamma\fR\fB:\fR\fIrra-num\fR[\fB:smoothing\-window=\fR\fIfraction\fR] .IP "\(bu" 4 \&\fB\s-1RRA:\s0\fR\fI\s-1DEVPREDICT\s0\fR\fB:\fR\fIrows\fR\fB:\fR\fIrra-num\fR .IP "\(bu" 4 \&\fB\s-1RRA:\s0\fR\fI\s-1FAILURES\s0\fR\fB:\fR\fIrows\fR\fB:\fR\fIthreshold\fR\fB:\fR\fIwindow length\fR\fB:\fR\fIrra-num\fR .PP These \fBRRAs\fR differ from the true consolidation functions in several ways. First, each of the \fB\s-1RRA\s0\fRs is updated once for every primary data point. Second, these \fBRRAs\fR are interdependent. To generate real-time confidence bounds, a matched set of \s-1SEASONAL, DEVSEASONAL, DEVPREDICT,\s0 and either \&\s-1HWPREDICT\s0 or \s-1MHWPREDICT\s0 must exist. Generating smoothed values of the primary data points requires a \s-1SEASONAL\s0 \fB\s-1RRA\s0\fR and either an \s-1HWPREDICT\s0 or \s-1MHWPREDICT\s0 \&\fB\s-1RRA\s0\fR. Aberrant behavior detection requires \s-1FAILURES, DEVSEASONAL, SEASONAL,\s0 and either \s-1HWPREDICT\s0 or \s-1MHWPREDICT.\s0 .PP The predicted, or smoothed, values are stored in the \s-1HWPREDICT\s0 or \s-1MHWPREDICT\s0 \&\fB\s-1RRA\s0\fR. \s-1HWPREDICT\s0 and \s-1MHWPREDICT\s0 are actually two variations on the Holt-Winters method. They are interchangeable. Both attempt to decompose data into three components: a baseline, a trend, and a seasonal coefficient. \&\s-1HWPREDICT\s0 adds its seasonal coefficient to the baseline to form a prediction, whereas \&\s-1MHWPREDICT\s0 multiplies its seasonal coefficient by the baseline to form a prediction. The difference is noticeable when the baseline changes significantly in the course of a season; \s-1HWPREDICT\s0 will predict the seasonality to stay constant as the baseline changes, but \s-1MHWPREDICT\s0 will predict the seasonality to grow or shrink in proportion to the baseline. The proper choice of method depends on the thing being modeled. For simplicity, the rest of this discussion will refer to \s-1HWPREDICT,\s0 but \s-1MHWPREDICT\s0 may be substituted in its place. .PP The predicted deviations are stored in \s-1DEVPREDICT\s0 (think a standard deviation which can be scaled to yield a confidence band). The \s-1FAILURES\s0 \fB\s-1RRA\s0\fR stores binary indicators. A 1 marks the indexed observation as failure; that is, the number of confidence bounds violations in the preceding window of observations met or exceeded a specified threshold. An example of using these \fBRRAs\fR to graph confidence bounds and failures appears in rrdgraph. .PP The \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 \fBRRAs\fR store the seasonal coefficients for the Holt-Winters forecasting algorithm and the seasonal deviations, respectively. There is one entry per observation time point in the seasonal cycle. For example, if primary data points are generated every five minutes and the seasonal cycle is 1 day, both \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 will have 288 rows. .PP In order to simplify the creation for the novice user, in addition to supporting explicit creation of the \s-1HWPREDICT, SEASONAL, DEVPREDICT, DEVSEASONAL,\s0 and \s-1FAILURES\s0 \fBRRAs\fR, the \fBRRDtool\fR create command supports implicit creation of the other four when \s-1HWPREDICT\s0 is specified alone and the final argument \fIrra-num\fR is omitted. .PP \&\fIrows\fR specifies the length of the \fB\s-1RRA\s0\fR prior to wrap around. Remember that there is a one-to-one correspondence between primary data points and entries in these RRAs. For the \s-1HWPREDICT CF,\s0 \fIrows\fR should be larger than the \fIseasonal period\fR. If the \s-1DEVPREDICT\s0 \fB\s-1RRA\s0\fR is implicitly created, the default number of rows is the same as the \s-1HWPREDICT\s0 \fIrows\fR argument. If the \&\s-1FAILURES\s0 \fB\s-1RRA\s0\fR is implicitly created, \fIrows\fR will be set to the \fIseasonal period\fR argument of the \s-1HWPREDICT\s0 \fB\s-1RRA\s0\fR. Of course, the \fBRRDtool\fR \&\fIresize\fR command is available if these defaults are not sufficient and the creator wishes to avoid explicit creations of the other specialized function \&\fBRRAs\fR. .PP \&\fIseasonal period\fR specifies the number of primary data points in a seasonal cycle. If \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 are implicitly created, this argument for those \fBRRAs\fR is set automatically to the value specified by \s-1HWPREDICT.\s0 If they are explicitly created, the creator should verify that all three \&\fIseasonal period\fR arguments agree. .PP \&\fIalpha\fR is the adaption parameter of the intercept (or baseline) coefficient in the Holt-Winters forecasting algorithm. See rrdtool for a description of this algorithm. \fIalpha\fR must lie between 0 and 1. A value closer to 1 means that more recent observations carry greater weight in predicting the baseline component of the forecast. A value closer to 0 means that past history carries greater weight in predicting the baseline component. .PP \&\fIbeta\fR is the adaption parameter of the slope (or linear trend) coefficient in the Holt-Winters forecasting algorithm. \fIbeta\fR must lie between 0 and 1 and plays the same role as \fIalpha\fR with respect to the predicted linear trend. .PP \&\fIgamma\fR is the adaption parameter of the seasonal coefficients in the Holt-Winters forecasting algorithm (\s-1HWPREDICT\s0) or the adaption parameter in the exponential smoothing update of the seasonal deviations. It must lie between 0 and 1. If the \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 \fBRRAs\fR are created implicitly, they will both have the same value for \fIgamma\fR: the value specified for the \s-1HWPREDICT\s0 \fIalpha\fR argument. Note that because there is one seasonal coefficient (or deviation) for each time point during the seasonal cycle, the adaptation rate is much slower than the baseline. Each seasonal coefficient is only updated (or adapts) when the observed value occurs at the offset in the seasonal cycle corresponding to that coefficient. .PP If \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 \fBRRAs\fR are created explicitly, \fIgamma\fR need not be the same for both. Note that \fIgamma\fR can also be changed via the \&\fBRRDtool\fR \fItune\fR command. .PP \&\fIsmoothing-window\fR specifies the fraction of a season that should be averaged around each point. By default, the value of \fIsmoothing-window\fR is 0.05, which means each value in \s-1SEASONAL\s0 and \s-1DEVSEASONAL\s0 will be occasionally replaced by averaging it with its (\fIseasonal period\fR*0.05) nearest neighbors. Setting \fIsmoothing-window\fR to zero will disable the running-average smoother altogether. .PP \&\fIrra-num\fR provides the links between related \fBRRAs\fR. If \s-1HWPREDICT\s0 is specified alone and the other \fBRRAs\fR are created implicitly, then there is no need to worry about this argument. If \fBRRAs\fR are created explicitly, then carefully pay attention to this argument. For each \&\fB\s-1RRA\s0\fR which includes this argument, there is a dependency between that \fB\s-1RRA\s0\fR and another \fB\s-1RRA\s0\fR. The \fIrra-num\fR argument is the 1\-based index in the order of \fB\s-1RRA\s0\fR creation (that is, the order they appear in the \fIcreate\fR command). The dependent \fB\s-1RRA\s0\fR for each \fB\s-1RRA\s0\fR requiring the \fIrra-num\fR argument is listed here: .IP "\(bu" 4 \&\s-1HWPREDICT\s0 \fIrra-num\fR is the index of the \s-1SEASONAL\s0 \fB\s-1RRA\s0\fR. .IP "\(bu" 4 \&\s-1SEASONAL\s0 \fIrra-num\fR is the index of the \s-1HWPREDICT\s0 \fB\s-1RRA\s0\fR. .IP "\(bu" 4 \&\s-1DEVPREDICT\s0 \fIrra-num\fR is the index of the \s-1DEVSEASONAL\s0 \fB\s-1RRA\s0\fR. .IP "\(bu" 4 \&\s-1DEVSEASONAL\s0 \fIrra-num\fR is the index of the \s-1HWPREDICT\s0 \fB\s-1RRA\s0\fR. .IP "\(bu" 4 \&\s-1FAILURES\s0 \fIrra-num\fR is the index of the \s-1DEVSEASONAL\s0 \fB\s-1RRA\s0\fR. .PP \&\fIthreshold\fR is the minimum number of violations (observed values outside the confidence bounds) within a window that constitutes a failure. If the \&\s-1FAILURES\s0 \fB\s-1RRA\s0\fR is implicitly created, the default value is 7. .PP \&\fIwindow length\fR is the number of time points in the window. Specify an integer greater than or equal to the threshold and less than or equal to 28. The time interval this window represents depends on the interval between primary data points. If the \s-1FAILURES\s0 \fB\s-1RRA\s0\fR is implicitly created, the default value is 9. .SH "STEP, HEARTBEAT, and Rows As Durations" .IX Header "STEP, HEARTBEAT, and Rows As Durations" Traditionally RRDtool specified \s-1PDP\s0 intervals in seconds, and most other values as either seconds or \s-1PDP\s0 counts. This made the specification for databases rather opaque; for example .PP .Vb 7 \& rrdtool create power.rrd \e \& \-\-start now\-2h \-\-step 1 \e \& DS:watts:GAUGE:300:0:24000 \e \& RRA:AVERAGE:0.5:1:864000 \e \& RRA:AVERAGE:0.5:60:129600 \e \& RRA:AVERAGE:0.5:3600:13392 \e \& RRA:AVERAGE:0.5:86400:3660 .Ve .PP creates a database of power values collected once per second, with a five minute (300 second) heartbeat, and four \fB\s-1RRA\s0\fRs: ten days of one second, 90 days of one minute, 18 months of one hour, and ten years of one day averages. .PP Step, heartbeat, and \s-1PDP\s0 counts and rows may also be specified as durations, which are positive integers with a single-character suffix that specifies a scaling factor. See \*(L"rrd_scaled_duration\*(R" in librrd for scale factors of the supported suffixes: \f(CW\*(C`s\*(C'\fR (seconds), \f(CW\*(C`m\*(C'\fR (minutes), \f(CW\*(C`h\*(C'\fR (hours), \f(CW\*(C`d\*(C'\fR (days), \f(CW\*(C`w\*(C'\fR (weeks), \f(CW\*(C`M\*(C'\fR (months), and \&\f(CW\*(C`y\*(C'\fR (years). .PP Scaled step and heartbeat values (which are natively durations in seconds) are used directly, while consolidation function row arguments are divided by their step to produce the number of rows. .PP With this feature the same specification as above can be written as: .PP .Vb 7 \& rrdtool create power.rrd \e \& \-\-start now\-2h \-\-step 1s \e \& DS:watts:GAUGE:5m:0:24000 \e \& RRA:AVERAGE:0.5:1s:10d \e \& RRA:AVERAGE:0.5:1m:90d \e \& RRA:AVERAGE:0.5:1h:18M \e \& RRA:AVERAGE:0.5:1d:10y .Ve .SH "The HEARTBEAT and the STEP" .IX Header "The HEARTBEAT and the STEP" Here is an explanation by Don Baarda on the inner workings of RRDtool. It may help you to sort out why all this *UNKNOWN* data is popping up in your databases: .PP RRDtool gets fed samples/updates at arbitrary times. From these it builds Primary Data Points (PDPs) on every \*(L"step\*(R" interval. The PDPs are then accumulated into the RRAs. .PP The \*(L"heartbeat\*(R" defines the maximum acceptable interval between samples/updates. If the interval between samples is less than \*(L"heartbeat\*(R", then an average rate is calculated and applied for that interval. If the interval between samples is longer than \*(L"heartbeat\*(R", then that entire interval is considered \*(L"unknown\*(R". Note that there are other things that can make a sample interval \*(L"unknown\*(R", such as the rate exceeding limits, or a sample that was explicitly marked as unknown. .PP The known rates during a \s-1PDP\s0's \*(L"step\*(R" interval are used to calculate an average rate for that \s-1PDP.\s0 If the total \*(L"unknown\*(R" time accounts for more than \fBhalf\fR the \*(L"step\*(R", the entire \s-1PDP\s0 is marked as \*(L"unknown\*(R". This means that a mixture of known and \*(L"unknown\*(R" sample times in a single \s-1PDP\s0 \*(L"step\*(R" may or may not add up to enough \*(L"known\*(R" time to warrant a known \s-1PDP.\s0 .PP The \*(L"heartbeat\*(R" can be short (unusual) or long (typical) relative to the \*(L"step\*(R" interval between PDPs. A short \*(L"heartbeat\*(R" means you require multiple samples per \s-1PDP,\s0 and if you don't get them mark the \&\s-1PDP\s0 unknown. A long heartbeat can span multiple \*(L"steps\*(R", which means it is acceptable to have multiple PDPs calculated from a single sample. An extreme example of this might be a \*(L"step\*(R" of 5 minutes and a \&\*(L"heartbeat\*(R" of one day, in which case a single sample every day will result in all the PDPs for that entire day period being set to the same average rate. \fI\-\- Don Baarda \fR .PP .Vb 10 \& time| \& axis| \& begin_\|_|00| \& |01| \& u|02|\-\-\-\-* sample1, restart "hb"\-timer \& u|03| / \& u|04| / \& u|05| / \& u|06|/ "hbt" expired \& u|07| \& |08|\-\-\-\-* sample2, restart "hb" \& |09| / \& |10| / \& u|11|\-\-\-\-* sample3, restart "hb" \& u|12| / \& u|13| / \& step1_u|14| / \& u|15|/ "swt" expired \& u|16| \& |17|\-\-\-\-* sample4, restart "hb", create "pdp" for step1 = \& |18| / = unknown due to 10 "u" labeled secs > 0.5 * step \& |19| / \& |20| / \& |21|\-\-\-\-* sample5, restart "hb" \& |22| / \& |23| / \& |24|\-\-\-\-* sample6, restart "hb" \& |25| / \& |26| / \& |27|\-\-\-\-* sample7, restart "hb" \& step2_\|_|28| / \& |22| / \& |23|\-\-\-\-* sample8, restart "hb", create "pdp" for step1, create "cdp" \& |24| / \& |25| / .Ve .PP graphics by \fIvladimir.lavrov@desy.de\fR. .SH "HOW TO MEASURE" .IX Header "HOW TO MEASURE" Here are a few hints on how to measure: .IP "Temperature" 4 .IX Item "Temperature" Usually you have some type of meter you can read to get the temperature. The temperature is not really connected with a time. The only connection is that the temperature reading happened at a certain time. You can use the \&\fB\s-1GAUGE\s0\fR data source type for this. RRDtool will then record your reading together with the time. .IP "Mail Messages" 4 .IX Item "Mail Messages" Assume you have a method to count the number of messages transported by your mail server in a certain amount of time, giving you data like '5 messages in the last 65 seconds'. If you look at the count of 5 like an \&\fB\s-1ABSOLUTE\s0\fR data type you can simply update the \s-1RRD\s0 with the number 5 and the end time of your monitoring period. RRDtool will then record the number of messages per second. If at some later stage you want to know the number of messages transported in a day, you can get the average messages per second from RRDtool for the day in question and multiply this number with the number of seconds in a day. Because all math is run with Doubles, the precision should be acceptable. .IP "It's always a Rate" 4 .IX Item "It's always a Rate" RRDtool stores rates in amount/second for \s-1COUNTER, DERIVE, DCOUNTER, DDERIVE\s0 and \s-1ABSOLUTE\s0 data. When you plot the data, you will get on the y axis amount/second which you might be tempted to convert to an absolute amount by multiplying by the delta-time between the points. RRDtool plots continuous data, and as such is not appropriate for plotting absolute amounts as for example \*(L"total bytes\*(R" sent and received in a router. What you probably want is plot rates that you can scale to bytes/hour, for example, or plot absolute amounts with another tool that draws bar-plots, where the delta-time is clear on the plot for each point (such that when you read the graph you see for example \s-1GB\s0 on the y axis, days on the x axis and one bar for each day). .SH "EXAMPLE" .IX Header "EXAMPLE" .Vb 6 \& rrdtool create temperature.rrd \-\-step 300 \e \& DS:temp:GAUGE:600:\-273:5000 \e \& RRA:AVERAGE:0.5:1:1200 \e \& RRA:MIN:0.5:12:2400 \e \& RRA:MAX:0.5:12:2400 \e \& RRA:AVERAGE:0.5:12:2400 .Ve .PP This sets up an \fB\s-1RRD\s0\fR called \fItemperature.rrd\fR which accepts one temperature value every 300 seconds. If no new data is supplied for more than 600 seconds, the temperature becomes \fI*UNKNOWN*\fR. The minimum acceptable value is \-273 and the maximum is 5'000. .PP A few archive areas are also defined. The first stores the temperatures supplied for 100 hours (1'200 * 300 seconds = 100 hours). The second \s-1RRA\s0 stores the minimum temperature recorded over every hour (12 * 300 seconds = 1 hour), for 100 days (2'400 hours). The third and the fourth \s-1RRA\s0's do the same for the maximum and average temperature, respectively. .SH "EXAMPLE 2" .IX Header "EXAMPLE 2" .Vb 4 \& rrdtool create monitor.rrd \-\-step 300 \e \& DS:ifOutOctets:COUNTER:1800:0:4294967295 \e \& RRA:AVERAGE:0.5:1:2016 \e \& RRA:HWPREDICT:1440:0.1:0.0035:288 .Ve .PP This example is a monitor of a router interface. The first \fB\s-1RRA\s0\fR tracks the traffic flow in octets; the second \fB\s-1RRA\s0\fR generates the specialized functions \fBRRAs\fR for aberrant behavior detection. Note that the \fIrra-num\fR argument of \s-1HWPREDICT\s0 is missing, so the other \fBRRAs\fR will implicitly be created with default parameter values. In this example, the forecasting algorithm baseline adapts quickly; in fact the most recent one hour of observations (each at 5 minute intervals) accounts for 75% of the baseline prediction. The linear trend forecast adapts much more slowly. Observations made during the last day (at 288 observations per day) account for only 65% of the predicted linear trend. Note: these computations rely on an exponential smoothing formula described in the \s-1LISA 2000\s0 paper. .PP The seasonal cycle is one day (288 data points at 300 second intervals), and the seasonal adaption parameter will be set to 0.1. The \s-1RRD\s0 file will store 5 days (1'440 data points) of forecasts and deviation predictions before wrap around. The file will store 1 day (a seasonal cycle) of 0\-1 indicators in the \s-1FAILURES\s0 \fB\s-1RRA\s0\fR. .PP The same \s-1RRD\s0 file and \fBRRAs\fR are created with the following command, which explicitly creates all specialized function \fBRRAs\fR using \*(L"\s-1STEP, HEARTBEAT,\s0 and Rows As Durations\*(R". .PP .Vb 8 \& rrdtool create monitor.rrd \-\-step 5m \e \& DS:ifOutOctets:COUNTER:30m:0:4294967295 \e \& RRA:AVERAGE:0.5:1:2016 \e \& RRA:HWPREDICT:5d:0.1:0.0035:1d:3 \e \& RRA:SEASONAL:1d:0.1:2 \e \& RRA:DEVSEASONAL:1d:0.1:2 \e \& RRA:DEVPREDICT:5d:5 \e \& RRA:FAILURES:1d:7:9:5 .Ve .PP Of course, explicit creation need not replicate implicit create, a number of arguments could be changed. .SH "EXAMPLE 3" .IX Header "EXAMPLE 3" .Vb 5 \& rrdtool create proxy.rrd \-\-step 300 \e \& DS:Requests:DERIVE:1800:0:U \e \& DS:Duration:DERIVE:1800:0:U \e \& DS:AvgReqDur:COMPUTE:Duration,Requests,0,EQ,1,Requests,IF,/ \e \& RRA:AVERAGE:0.5:1:2016 .Ve .PP This example is monitoring the average request duration during each 300 sec interval for requests processed by a web proxy during the interval. In this case, the proxy exposes two counters, the number of requests processed since boot and the total cumulative duration of all processed requests. Clearly these counters both have some rollover point, but using the \&\s-1DERIVE\s0 data source also handles the reset that occurs when the web proxy is stopped and restarted. .PP In the \fB\s-1RRD\s0\fR, the first data source stores the requests per second rate during the interval. The second data source stores the total duration of all requests processed during the interval divided by 300. The \s-1COMPUTE\s0 data source divides each \s-1PDP\s0 of the AccumDuration by the corresponding \s-1PDP\s0 of TotalRequests and stores the average request duration. The remainder of the \&\s-1RPN\s0 expression handles the divide by zero case. .SH "SECURITY" .IX Header "SECURITY" Note that new rrd files will have the permission 0644 regardless of your umask setting. If a file with the same name previously exists, its permission settings will be copied to the new file. .SH "AUTHORS" .IX Header "AUTHORS" Tobias Oetiker , Peter Stamfest