Posted 5 Juni, 2007on:
This page details the installation and configuration of RRDTool on a linux box.
I initially experimented with MRTG (Multi Router Traffic Grapher) for trending the link details.
However, MRTG didn’t support trending of negative numbers (ie, signal and noise levels of a wireless connection), and didn’t support fractions (ie, a link rate of 5.5Mbits/s).
I decided to look at RRDTool (Round Robin Database), because, in the words of the author of both MRTG and RRDTool:
I’ve certainly found RRDTool to be more flexible than MRTG, and the resulting graphs look much nicer than the MRTG graphs.
I use RRDTool for monitoring various parameters on a number of linux boxes – refer to the What’s Next section below for more details.
- a Linux box
- a web server running on the Linux box
- an RRDTool tarball
- an SCP client (such as WinSCP, or SSH Secure File Transfer Client, part of SSH Secure Shell) for copying files onto your linux box.
- a way of getting a command-line prompt on your linux box (either by logging directly onto your linux box, using a SSH client such as PuTTY or SSH Secure Shell).
Note that I’m using a custom installation of Red Hat 9 linux.
If your configuration is different, you may need to adjust some parts of the installation instructions appropriately.
Download the latest version of RRDTool from the RRDTool download page.
This page originally detailed the installation and configuration of the 1.0.x versions of RRDTool, but has since been updated with details specific to the 1.2.x versions of RRDTool.
When this page was last updated, RRDTool 1.2.12 was the most recent stable version, so I downloaded from a local mirror in Australia: rrdtool-1.2.12.tar.gz.
For RedHat 9, you’ll need to install the following RPMs from the RH9 CD:
Each of the above RPMs can be installed using the following syntax:
rpm -Uvh rpmname.rpm
cd /usr/src tar -xzvf rrdtool-1.2.12.tar.gz
Change into the newly created directory:
Compile and install RRDTool:
./configure --disable-tcl make make install
TCL is disabled, as compilation of some of the TCL components for RRDTool 1.2.12 will otherwise fail on RedHat 9.
Run ./configure –help for more information on configuration options.
The default installation location is /usr/local/rrdtool-VERSION, so make some symbolic links to the executables:
ln -sf /usr/local/rrdtool-1.2.12/bin/rrdtool /usr/bin/rrdtool ln -sf /usr/local/rrdtool-1.2.12/bin/rrdupdate /usr/bin/rrdupdate ln -sf /usr/local/rrdtool-1.2.12/bin/rrdcgi /usr/bin/rrdcgi
The RRDTool Perl library simplifies things when using RRDTool from a Perl script, so to compile and install the Perl library for RRDTool:
Create a directory for RRDTool databases, and a directory for the web images which it’ll generate:
mkdir /var/lib/rrd mkdir /var/www/html/rrdtool
I’m using RRDTool to monitor these parameters:
- wireless link signal, noise and SNR
- network traffic on each interface (bytes in/out)
- system load
- memory usage
- motherboard, CPU temperature, PSU voltages (using lm_sensors)
- HDD temperature (using hddtemp)
- local Perth weather (temp, wind speed, wind direction, rainfall, humidity, pressure)
- uptime of my ADSL connection
- peak/offpeak quota and non-quota traffic from my ISP
It’s just a matter of creating an RRD database, writing a script to retrieve the data, insert the data into the RRD database, and generate a graph.
Also have a look at the RRDTool Gallery for more examples of how people are using RRDTool.
Source – http://martybugs.net/linux/rrdtool/