Section 13.1. RRDtool


13.1. RRDtool

RRDtool is the Round Robin Database Tool. Round robin is a technique that works with a fixed amount of data and a pointer to the current element. Think of a circle with some dots plotted on the edgethese dots are the places where data can be stored. Draw an arrow from the center of the circle to one of the dotsthis is the pointer. When the current data is read or written, the pointer moves to the next element. After a while, all the available places are used and the process automatically reuses old locations. This way, the dataset does not grow in size and therefore requires no maintenance. RRDtool works with Round Robin Databases (RRDs). It stores and retrieves data from them.

RRDtool originated from MRTG, which we cover in Chapter 12. MRTG started as a tiny little script for graphing the use of a university's connection to the Internet. MRTG was later used (some might say abused) as a tool for graphing other data sources, including temperature, speed, voltage, number of printouts, and the like.

Most likely you will start to use RRDtool to store and process data collected via SNMP. The data will probably be bytes (or bits) transferred from and to a network or a computer. But it can also be used to display tidal waves, solar radiation, power consumption, the number of visitors at an exhibition, the noise levels near an airport, the temperature at your favorite holiday location, the temperature in the fridge, or whatever your imagination can come up with. It's incredibly flexible.

You need only a sensor to measure the data, and the ability to feed the numbers into RRDtool . RRDtool then lets you create a database, store data in it, retrieve that data, and create graphs in PNG format for display on a web browser. The PNG images are dependent on the data you collect, and they could represent, for instance, an overview of the average network usage, or the peaks that occur.

This chapter focuses on installing RRDtool and Cricket. Cricket is used to gather SNMP data points, store the data in RRDtool, and display the data in graphs.

13.1.1. Installing RRDtool

The latest version of the software can be found at http://www.rrdtool.org. RRDtool requires that you install several third-party libraries, including libart, libpng, zlib, freetype, and cgilib. Luckily, you can find copies of these packages at http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs. However, if you wish to go directly to home pages for these packages and download them from the source, when you run RRDtool's configure script it will tell you what packages you don't have installed and where you can obtain them. You will need Perl installed (if it isn't already) and a C compiler like gcc. Once you have downloaded and untarred the RRDtool distribution, use these three commands to build and install it:

     [root@machine rrdtool-1.2.9]# ./configure --enable-perl-site-install     [root@machine rrdtool-1.2.9]# make     [root@machine rrdtool-1.2.9]# make install 

Note the option passed to the configure command. This installs the RRDtool Perl modules, used by Cricket, in the normal Perl site location. These commands produce a good amount of output. Once installed, RRDtool will be, by default, stored in /usr/local/rrdtool-1.2.9. If you wish to change this directory, run configure like this:

     [root@machine rrdtool-1.2.9]# ./configure --prefix= /path/to/install 

That's all you need to do. Next we show how to install, configure, and use Cricket.




Essential SNMP
Essential SNMP, Second Edition
ISBN: 0596008406
EAN: 2147483647
Year: 2003
Pages: 165

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net