.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 .\" ======================================================================== .\" .IX Title "RRDTOOL 1" .TH RRDTOOL 1 2024-01-10 1.7.2 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 rrdtool \- Round Robin Database Tool .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBrrdtool\fR \fB\-\fR [workdir]| \fIfunction\fR .SH DESCRIPTION .IX Header "DESCRIPTION" .SS OVERVIEW .IX Subsection "OVERVIEW" It is pretty easy to gather status information from all sorts of things, ranging from the temperature in your office to the number of octets which have passed through the FDDI interface of your router. But it is not so trivial to store this data in an efficient and systematic manner. This is where \fBRRDtool\fR comes in handy. It lets you \&\fIlog and analyze\fR the data you gather from all kinds of data-sources (\fBDS\fR). The data analysis part of RRDtool is based on the ability to quickly generate graphical representations of the data values collected over a definable time period. .PP In this man page you will find general information on the design and functionality of the Round Robin Database Tool (RRDtool). For a more detailed description of how to use the individual functions of \&\fBRRDtool\fR check the corresponding man page. .PP For an introduction to the usage of RRDtool make sure you consult the rrdtutorial. .SS FUNCTIONS .IX Subsection "FUNCTIONS" While the man pages talk of command line switches you have to set in order to make \fBRRDtool\fR work it is important to note that \&\fBRRDtool\fR can be remotely controlled through a set of pipes. This saves a considerable amount of startup time when you plan to make \&\fBRRDtool\fR do a lot of things quickly. Check the section on "REMOTE CONTROL" further down. There is also a number of language bindings for RRDtool which allow you to use it directly from Perl, python, Tcl, PHP, etc. .IP \fBcreate\fR 8 .IX Item "create" Set up a new Round Robin Database (RRD). Check rrdcreate. .IP \fBupdate\fR 8 .IX Item "update" Store new data values into an RRD. Check rrdupdate. .IP \fBupdatev\fR 8 .IX Item "updatev" Operationally equivalent to \fBupdate\fR except for output. Check rrdupdate. .IP \fBgraph\fR 8 .IX Item "graph" Create a graph from data stored in one or several RRDs. Apart from generating graphs, data can also be extracted to stdout. Check rrdgraph. .IP \fBgraphv\fR 8 .IX Item "graphv" Create a graph from data stored in one or several RRDs. Same as graph, but metadata are printed before the graph. Check rrdgraph. .IP \fBdump\fR 8 .IX Item "dump" Dump the contents of an RRD in plain ASCII. In connection with restore you can use this to move an RRD from one computer architecture to another. Check rrddump. .IP \fBrestore\fR 8 .IX Item "restore" Restore an RRD in XML format to a binary RRD. Check rrdrestore .IP \fBfetch\fR 8 .IX Item "fetch" Get data for a certain time period from a RRD. The graph function uses fetch to retrieve its data from an RRD. Check rrdfetch. .IP \fBtune\fR 8 .IX Item "tune" Alter setup and structure of an RRD. Check rrdtune. .IP \fBfirst\fR 8 .IX Item "first" Find the first update time of an RRD. Check rrdfirst. .IP \fBlast\fR 8 .IX Item "last" Find the last update time of an RRD. Check rrdlast. .IP \fBlastupdate\fR 8 .IX Item "lastupdate" Find the last update time of an RRD. It also returns the value stored for each datum in the most recent update. Check rrdlastupdate. .IP \fBinfo\fR 8 .IX Item "info" Get information about an RRD. Check rrdinfo. .IP \fBresize\fR 8 .IX Item "resize" Change the size of individual RRAs. This is dangerous! Check rrdresize. .IP \fBxport\fR 8 .IX Item "xport" Export data retrieved from one or several RRDs. Check rrdxport. .IP \fBflushcached\fR 8 .IX Item "flushcached" Flush the values for a specific RRD file from memory. Check rrdflushcached. .IP \fBlist\fR 8 .IX Item "list" List the directories and rrd databases remotely. Check rrdlist. .SS "HOW DOES RRDTOOL WORK?" .IX Subsection "HOW DOES RRDTOOL WORK?" .IP "Data Acquisition" 8 .IX Item "Data Acquisition" When monitoring the state of a system, it is convenient to have the data available at a constant time interval. Unfortunately, you may not always be able to fetch data at exactly the time you want to. Therefore \fBRRDtool\fR lets you update the log file at any time you want. It will automatically interpolate the value of the data-source (\fBDS\fR) at the latest official time-slot (interval) and write this interpolated value to the log. The original value you have supplied is stored as well and is also taken into account when interpolating the next log entry. .IP Consolidation 8 .IX Item "Consolidation" You may log data at a 1 minute interval, but you might also be interested to know the development of the data over the last year. You could do this by simply storing the data in 1 minute intervals for the whole year. While this would take considerable disk space it would also take a lot of time to analyze the data when you wanted to create a graph covering the whole year. \fBRRDtool\fR offers a solution to this problem through its data consolidation feature. When setting up a Round Robin Database (\fBRRD\fR), you can define at which interval this consolidation should occur, and what consolidation function (\fBCF\fR) (average, minimum, maximum, last) should be used to build the consolidated values (see rrdcreate). You can define any number of different consolidation setups within one \fBRRD\fR. They will all be maintained on the fly when new data is loaded into the \fBRRD\fR. .IP "Round Robin Archives" 8 .IX Item "Round Robin Archives" Data values of the same consolidation setup are stored into Round Robin Archives (\fBRRA\fR). This is a very efficient manner to store data for a certain amount of time, while using a known and constant amount of storage space. .Sp It works like this: If you want to store 1'000 values in 5 minute interval, \fBRRDtool\fR will allocate space for 1'000 data values and a header area. In the header it will store a pointer telling which slots (value) in the storage area was last written to. New values are written to the Round Robin Archive in, you guessed it, a round robin manner. This automatically limits the history to the last 1'000 values (in our example). Because you can define several \fBRRA\fRs within a single \fBRRD\fR, you can setup another one, for storing 750 data values at a 2 hour interval, for example, and thus keep a log for the last two months at a lower resolution. .Sp The use of \fBRRA\fRs guarantees that the \fBRRD\fR does not grow over time and that old data is automatically eliminated. By using the consolidation feature, you can still keep data for a very long time, while gradually reducing the resolution of the data along the time axis. .Sp Using different consolidation functions (\fBCF\fR) allows you to store exactly the type of information that actually interests you: the maximum one minute traffic on the LAN, the minimum temperature of your wine cellar, ... etc. .IP "Unknown Data" 8 .IX Item "Unknown Data" As mentioned earlier, the \fBRRD\fR stores data at a constant interval. Sometimes it may happen that no new data is available when a value has to be written to the \fBRRD\fR. Data acquisition may not be possible for one reason or other. With \fBRRDtool\fR you can handle these situations by storing an \fI*UNKNOWN*\fR value into the database. The value '\fI*UNKNOWN*\fR' is supported through all the functions of the tool. When consolidating a data set, the amount of \fI*UNKNOWN*\fR data values is accounted for and when a new consolidated value is ready to be written to its Round Robin Archive (\fBRRA\fR), a validity check is performed to make sure that the percentage of unknown values in the data point is above a configurable level. If not, an \fI*UNKNOWN*\fR value will be written to the \fBRRA\fR. .IP Graphing 8 .IX Item "Graphing" \&\fBRRDtool\fR allows you to generate reports in numerical and graphical form based on the data stored in one or several \&\fBRRD\fRs. The graphing feature is fully configurable. Size, color and contents of the graph can be defined freely. Check rrdgraph for more information on this. .IP "Aberrant Behavior Detection" 8 .IX Item "Aberrant Behavior Detection" by Jake Brutlag .Sp \&\fBRRDtool\fR provides the building blocks for near real-time aberrant behavior detection. These components include: .RS 8 .IP \(bu 4 An algorithm for predicting the value of a time series one time step into the future. .IP \(bu 4 A measure of deviation between predicted and observed values. .IP \(bu 4 A mechanism to decide if and when an observed value or sequence of observed values is \fItoo deviant\fR from the predicted value(s). .RE .RS 8 .Sp Here is a brief explanation of these components: .Sp The Holt-Winters time series forecasting algorithm is an on-line (or incremental) algorithm that adaptively predicts future observations in a time series. Its forecast is the sum of three components: a baseline (or intercept), a linear trend over time (or slope), and a seasonal coefficient (a periodic effect, such as a daily cycle). There is one seasonal coefficient for each time point in the period (cycle). After a value is observed, each of these components is updated via exponential smoothing. This means that the algorithm "learns" from past values and uses them to predict the future. The rate of adaptation is governed by 3 parameters, alpha (intercept), beta (slope), and gamma (seasonal). The prediction can also be viewed as a smoothed value for the time series. .Sp The measure of deviation is a seasonal weighted absolute deviation. The term \fIseasonal\fR means deviation is measured separately for each time point in the seasonal cycle. As with Holt-Winters forecasting, deviation is predicted using the measure computed from past values (but only at that point in the seasonal cycle). After the value is observed, the algorithm learns from the observed value via exponential smoothing. Confidence bands for the observed time series are generated by scaling the sequence of predicted deviation values (we usually think of the sequence as a continuous line rather than a set of discrete points). .Sp Aberrant behavior (a potential failure) is reported whenever the number of times the observed value violates the confidence bands meets or exceeds a specified threshold within a specified temporal window (e.g. 5 violations during the past 45 minutes with a value observed every 5 minutes). .Sp This functionality is embedded in a set of related \fBRRAs\fR. In particular, a FAILURES \fBRRA\fR logs potential failures. With these data you could, for example, use a front-end application to \fBRRDtool\fR to initiate real-time alerts. .Sp For a detailed description on how to set this up, see rrdcreate. .RE .SS "REMOTE CONTROL" .IX Subsection "REMOTE CONTROL" When you start \fBRRDtool\fR with the command line option '\fB\-\fR' it waits for input via standard input (STDIN). With this feature you can improve performance by attaching \fBRRDtool\fR to another process (MRTG is one example) through a set of pipes. Over these pipes \fBRRDtool\fR accepts the same arguments as on the command line and some special commands like \fBcd, mkdir, pwd, ls\fR and \fBquit\fR. For detailed help on the server commands type: .PP .Vb 1 \& rrdtool help cd .Ve .PP When a command is completed, RRDtool will print the string '\f(CW\*(C`OK\*(C'\fR', followed by timing information of the form \fBu:\fR\fIusertime\fR \&\fBs:\fR\fIsystemtime\fR. Both values are the running totals of seconds since RRDtool was started. If an error occurs, a line of the form '\f(CW\*(C`ERROR:\*(C'\fR \&\fIDescription of error\fR' will be printed instead. \fBRRDtool\fR will not abort, unless something really serious happens. If a \fBworkdir\fR is specified and the UID is 0, RRDtool will do a chroot to that workdir. If the UID is not 0, RRDtool only changes the current directory to \&\fBworkdir\fR. .SS "RRD Server" .IX Subsection "RRD Server" If you want to create a RRD-Server, you must choose a TCP/IP Service number and add them to \fI/etc/services\fR like this: .PP .Vb 1 \& rrdsrv 13900/tcp # RRD server .Ve .PP Attention: the TCP port 13900 isn't officially registered for rrdsrv. You can use any unused port in your services file, but the server and the client system must use the same port, of course. .PP With this configuration you can add RRDtool as meta-server to \&\fI/etc/inetd.conf\fR. For example: .PP .Vb 1 \& rrdsrv stream tcp nowait root /opt/rrd/bin/rrdtool rrdtool \- /var/rrd .Ve .PP Don't forget to create the database directory /var/rrd and reinitialize your inetd. .PP If all was setup correctly, you can access the server with Perl sockets, tools like netcat, or in a quick interactive test by using \&'telnet localhost rrdsrv'. .PP \&\fBNOTE:\fR that there is no authentication with this feature! Do not setup such a port unless you are sure what you are doing. .SH "RRDCACHED, THE CACHING DAEMON" .IX Header "RRDCACHED, THE CACHING DAEMON" For very big setups, updating thousands of RRD files often becomes a serious IO problem. If you run into such problems, you might want to take a look at rrdcached, a caching daemon for RRDtool which may help you lessen the stress on your disks. .SH "SEE ALSO" .IX Header "SEE ALSO" rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast, rrdxport, rrdflushcached, rrdcached .SH BUGS .IX Header "BUGS" Bugs? Features! .SH AUTHOR .IX Header "AUTHOR" Tobias Oetiker