.\" Automatically generated by Pod::Man 4.10 (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 "2022-04-14" "1.0.50" "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\s-1DS:\s0\fR\fIds-name\fR\fB:\fR\fI\s-1DST\s0\fR\fB:\fR\fIheartbeat\fR\fB:\fR\fImin\fR\fB:\fR\fImax\fR\ [\fB\s-1DS:\s0\fR...]\ ... \&\fB\s-1RRA:\s0\fR\fI\s-1CF\s0\fR\fB:\fR\fIxff\fR\fB:\fR\fIsteps\fR\fB:\fR\fIrows\fR\ [\fB\s-1RRA:\s0\fR...]\ ... .SH "DESCRIPTION" .IX Header "DESCRIPTION" The create function of the 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. .IP "\fIfilename\fR" 8 .IX Item "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. .IP "\fB\-\-start\fR|\fB\-b\fR \fIstart time\fR (default: now \- 10s)" 8 .IX Item "--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. .Sp See also AT-STYLE \s-1TIME SPECIFICATION\s0 section in the \&\fIrrdfetch\fR documentation for more ways to specify time. .IP "\fB\-\-step\fR|\fB\-s\fR \fIstep\fR (default: 300 seconds)" 8 .IX Item "--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. .IP "\fB\s-1DS:\s0\fR\fIds-name\fR\fB:\fR\fI\s-1DST\s0\fR\fB:\fR\fIheartbeat\fR\fB:\fR\fImin\fR\fB:\fR\fImax\fR" 8 .IX Item "DS:ds-name:DST:heartbeat:min:max" A single \fB\s-1RRD\s0\fR can accept input from several data sources (\fB\s-1DS\s0\fR). (e.g. 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 use to feed the \fB\s-1RRD\s0\fR. .Sp \&\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_]. .Sp \&\fI\s-1DST\s0\fR defines the Data Source Type. See the section on \*(L"How to Measure\*(R" below for further insight. The Data Source Type must be one of the following: .RS 8 .IP "\fB\s-1GAUGE\s0\fR" 4 .IX Item "GAUGE" is for things like temperatures or number of people in a room or value of a RedHat share. .IP "\fB\s-1COUNTER\s0\fR" 4 .IX Item "COUNTER" is for continuous incrementing counters like the InOctets 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-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-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 maximal time available before the next overflow. Another usage is for things you count like number of messages since the last update. .RE .RS 8 .Sp \&\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. .Sp \&\fImin\fR and \fImax\fR are optional entries defining the expected range of the data supplied by this data source. If \fImin\fR and/or \fImax\fR are defined, 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 max and min data-rate expected from the device. .Sp \&\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 .RE .IP "\fB\s-1RRA:\s0\fR\fI\s-1CF\s0\fR\fB:\fR\fIxff\fR\fB:\fR\fIsteps\fR\fB:\fR\fIrows\fR" 8 .IX Item "RRA:CF:xff:steps:rows" 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 from all the defined data-sources (\fB\s-1DS\s0\fR) and is defined with an \fB\s-1RRA\s0\fR line. .Sp 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 becoming a \fIprimary data point\fR. .Sp The data is also consolidated with the consolidation function (\fI\s-1CF\s0\fR) of the archive. The following consolidation functions are defined: \&\fB\s-1AVERAGE\s0\fR, \fB\s-1MIN\s0\fR, \fB\s-1MAX\s0\fR, \fB\s-1LAST\s0\fR. .Sp \&\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. .Sp \&\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. .Sp \&\fIrows\fR defines how many generations of data values are kept in an \fB\s-1RRA\s0\fR. .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 \&\s-1RRD\s0 gets fed samples at arbitrary times. From these it builds Primary Data Points (PDPs) at exact times every \*(L"step\*(R" interval. The PDPs are then accumulated into RRAs. .PP The \*(L"heartbeat\*(R" defines the maximum acceptable interval between samples. 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 even an \*(L"unknown\*(R" input sample. .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 Also, if the total \*(L"unknown\*(R" time during the \*(L"step\*(R" interval exceeds the \*(L"heartbeat\*(R", the entire \s-1PDP\s0 is marked as \*(L"unknown\*(R". This means that a mixture of known and \*(L"unknown\*(R" sample time in a single \s-1PDP\s0 \*(L"step\*(R" may or may not add up to enough \*(L"unknown\*(R" time to exceed \*(L"heartbeat\*(R" and hence mark the whole \s-1PDP\s0 \*(L"unknown\*(R". So \&\*(L"heartbeat\*(R" is not only the maximum acceptable interval between samples, but also the maximum acceptable amount of \*(L"unknown\*(R" time per \&\s-1PDP\s0 (obviously this is only significant if you have \*(L"heartbeat\*(R" less than \*(L"step\*(R"). .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 .SH "HOW TO MEASURE" .IX Header "HOW TO MEASURE" Here are a few hints on how to measure: .IP "Temperature" 4 .IX Item "Temperature" Normally 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 mailserver in a certain amount of time, this give you data like '5 messages in the last 65 seconds'. If you look at the count of 5 like and \&\fB\s-1ABSOLUTE\s0\fR datatype 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\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 absolute amount volume by multiplying by the delta-time between the points. RRDTool plots continuous data, and as such is not appropriate for plotting absolute volumes 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 for example bytes/hour or plot volumes 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" \&\f(CW\*(C`rrdtool create temperature.rrd \-\-step 300 DS:temp:GAUGE:600:\-273:5000 RRA:AVERAGE:0.5:1:1200 RRA:MIN:0.5:12:2400 RRA:MAX:0.5:12:2400 RRA:AVERAGE:0.5:12:2400\*(C'\fR .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 5000. .PP A few archives areas are also defined. The first stores the temperatures supplied for 100 hours (1200 * 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 (2400 hours). The third and the fourth \s-1RRA\s0's do the same for the maximum and average temperature, respectively. .SH "AUTHOR" .IX Header "AUTHOR" Tobias Oetiker