RRDtool Information

Written by on October 23, 2009 in GeekTool - Comments Off

I have seen many inquiries about the RRDtool so I decided to look up the information from the RRDtool website to see what RRDtool is about. I have not used  RRDtool because I am not technologically savvy. I will eventually try it though because it seems to be a pretty useful tool for logging information. I will post an update as soon as I try it and list any ‘oops’ that I run into.

RRDtool is an open source, high performance data logging and graphing system for time series data designed by Tobias Oetiker, a system manager at the Swiss Federal Institute of Technology. You can use it to write your own custom monitoring shell scripts or create entire applications using Perl, Python, Ruby, TCL or PHP bindings.

It is designed to store time series of data. With every data update, an associated time stamp is stored. The time is always expressed in seconds passed since epoch.  It can be installed on Unix as well as Windows and comes with a command set to carry out various operations on RRD databases. The command can be accessed from the command line, as well as from Shell or Perl scripts. Scripts act as wrappers for accessing data stored in RRDtool databases.

I apologize for not being as informed as I should be on RRDtool. I have decided to pull information from the RRDtool website with their links and provide an easy list for you to use. The information in quotes is from the website as a description for what each item is.

DOCUMENTATION:

rrdtool
“RRDtool lets you log and analyze the data you gather from all kinds of data-sources (DS). 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.”

rrdbuild
“If you downloaded the source of rrdtool you have to compile it. This document will give some information on how this is done. RRDtool relies on services of third part libraries. Some of these libraries may already be installed on your system. You have to compile copies of the other ones before you can build RRDtool. This document will tell you about all the necessary steps to get going. These instructions assume you are using a bash shell. If you use csh/tcsh, then you can either type bash to switch to bash for the compilation or if you know what you are doing just replace the export bits with setenv. We further assume that your copies of tar and make are actually GNU tar and GNU make respectively. It could be that they are installed as gtar and gmake on your system.”

rrdcgi
“rrdcgi is a sort of very limited script interpreter. Its purpose is to run as a cgi-program and parse a web page template containing special <RRD:: tags. rrdcgi will interpret and act according to these tags. In the end it will printout a web page including the necessary CGI headers.”

rrdcreate
“The create function of RRDtool lets you set up new Round Robin Database (RRD) files. The file is created at its final, full size and filled with *UNKNOWN* data.”

rrddump
“The dump function writes the contents of an RRD in human readable (?) XML format to a file or to stdout. This format can be read by rrdrestore. Together they allow you to transfer your files from one computer architecture to another as well to manipulate the contents of an RRD file in a somewhat more convenient manner.”

rrdfetch
“The fetch function is normally used internally by the graph function to get data from RRDs. fetch will analyze the RRD and try to retrieve the data in the resolution requested. The data fetched is printed to stdout. *UNKNOWN* data is often represented by the string “NaN” depending on your OS’s printf function.”

rrdfirst
“The first function returns the UNIX timestamp of the first data sample entered into the specified RRA of the RRD file.”

rrdgraph
“The graph function of RRDtool is used to present the data from an RRD to a human viewer. Its main purpose is to create a nice graphical representation, but it can also generate a numerical report.”

rrdgraph_data
“These three instructions extract data values out of the RRD files, optionally altering them (think, for example, of a bytes to bits conversion). If so desired, you can also define variables containing useful information such as maximum, minimum etcetera. Two of the instructions use a language called RPN which is described in its own manual page.
Variable names (vname) must be made up strings of the following characters A-Z, a-z, 0-9, -,_ and a maximum length of 255 characters.
When picking variable names, make sure you do not choose a name that is already taken by an RPN operator. A safe bet it to use lowercase or mixedcase names for variables since operators will always be in uppercase.”

rrdgraph_examples
“For your convenience some of the commands are explained here by using detailed examples. They are not always cut-and-paste ready because comments are intermixed with the examples.”

rrdgraph_graph
“These instructions allow you to generate your image or report. If you don’t use any graph elements, no graph is generated. Similarly, no report is generated if you don’t use print options.”

rrdgraph_rpn
“If you have ever used a traditional HP calculator you already know RPN (Reverse Polish Notation). The idea behind RPN is that you have a stack and push your data onto this stack. Whenever you execute an operation, it takes as many elements from the stack as needed. Pushing is done implicitly, so whenever you specify a number or a variable, it gets pushed onto the stack automatically.”

rrdinfo
“The info function prints the header information from an RRD in a parsing friendly format.
Check rrdcreate if you are uncertain about the meaning of the individual keys.”

rrdlast
“The last function returns the UNIX timestamp of the most recent update of the RRD.”

rrdlastupdate
“The lastupdate function returns the UNIX timestamp and the value stored for each datum in the most recent update of an RRD.”

rrdresize
“The resize function is used to modify the number of rows in an RRA.”

rrdrestore
“The restore function reads the XML representation of an RRD and converts it to the native RRD format.”

rrdtune
“The tune option allows you to alter some of the basic configuration values stored in the header area of a Round Robin Database (RRD).
One application of the tune function is to relax the validation rules on an RRD. This allows to fill a new RRD with data available in larger intervals than what you would normally want to permit. Be very careful with tune operations for COMPUTE data sources. Setting the min, max, and heartbeat for a COMPUTE data source without changing the data source type to a non-COMPUTE DST WILL corrupt the data source header in the RRD.
A second application of the tune function is to set or alter parameters used by the specialized function RRAs for aberrant behavior detection.”

rrdupdate
“The update function feeds new data values into an RRD. The data is time aligned (interpolated) according to the properties of the RRD to which the data is written.”

rrdxport
“The xport function’s main purpose is to write an XML formatted representation of the data stored in one or several RRDs. It can also extract numerical reports.
If no XPORT statements are found, there will be no output.”

TUTORIALS

rrd-tutorial
“RRDtool is written by Tobias Oetiker with contributions from many people all around the world. This document is written by Alex van den Bogaerdt  to help you understand what RRDtool is and what it can do for you.
The documentation provided with RRDtool can be too technical for some people. This tutorial is here to help you understand the basics of RRDtool. It should prepare you to read the documentation yourself. It also explains the general things about statistics with a focus on networking.”
bin_dec_hex
“Most people use the decimal numbering system. This system uses ten symbols to represent numbers. When those ten symbols are used up, they start all over again and increment the position to the left. The digit 0 is only shown if it is the only symbol in the sequence, or if it is not the first one.”

cdeftutorial
“Intention of this document: to provide some examples of the commonly used parts of RRDtool’s CDEF language.
If you think some important feature is not explained properly, and if adding it to this document would benefit most users, please do ask me to add it. I will then try to provide an answer in the next release of this tutorial. No feedback equals no changes! Additions to this document are also welcome.”

rpntutorial
“This tutorial should help you get to grips with RRDtool RPN expressions as seen in CDEF arguments of RRDtool graph.”

rrd-beginners
“This manual is an attempt to assist beginners in understanding the concepts of RRDtool. It sheds a light on differences between RRDtool and other databases. With help of an example, it explains the structure of RRDtool database. This is followed by an overview of the “graph” feature of RRDtool. At the end, it has sample scripts that illustrate the usage/wrapping of RRDtool within Shell or Perl scripts.”

RRDtool Programming
Consists of documentation on RRDMIB, RRDp, RRDs, rrdpython, rrdruby, and rrdthreads.

RRD Gallery
This is a gallery full of examples of using RRDtool.

I hope that this list helps those of you who are interested in employing the RRDtool. Their website has a plethora of information for your choosing. I have only compiled the basic information to help you get started. Again, all of this was pulled from the RRDtool website at: http://oss.oetiker.ch/rrdtool/index.en.html
This concludes this article. If you are talented at using RRDtool and want to provide comments for other readers, please, feel free to leave comments and spread the wealth!
-TINA

About the Author

I am currently working on an Associates in Art for Web Design. My interests include finding various apps for Mac OS and iPhone/iPad and tweaking the system. I also like finding ways to tweak my internet experience on Firefox, Safari, and Google Chrome. I also enjoy learning new things from others along with course work.

Comments are closed.