martybugs.net Linux Info
 navigation
. MartyBugs home
. linux info home
 
 software info
. installing RRDTool
 
 system health
. HDD Temp Monitoring
. Imaging a PC
 
 network traffic
. Traffic Monitoring with RRDTool
. Bandwidth Monitoring with ipac-ng
. WAIX IP Accounting
 
 wireless info
. Wireless Info
. Link Monitoring with RRDTool
 
 router config
. Linux Wireless Router
. Smoothwall Info
. Multiple AS with Quagga
 
 site search
Custom Search
 
Installing RRDTool

This page details the installation and configuration of RRDTool on a linux box.

Contents:   Background | Requirements | Obtaining | Installing | What's Next? | References

Background
Many years ago, when I first connected into the Perth Freenet, I wanted some easy way to monitor my wireless link details, ie, graph the SNR, signal and noise levels, and the link rate.

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:

If you know MRTG, you can think of RRDtool as a reimplementation of MRTGs graphing and logging features. Magnitudes faster and more flexible than you ever thought possible.

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.

Requirements
You'll need:
  • 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.

Obtaining RRDTool
If you are going to manually install RRDTool, then download either a binary distribution or the source code for 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 the source code from a local mirror in Australia: rrdtool-1.2.12.tar.gz.

Alternatively, if you are going to install RRDTool using apt-get or similar, then there's no need to download any binary distribution of RRDTool.

Installing Pre-Requisites
Note that RRDTool 1.0.x versions included all dependancies, but 1.2.x versions require you to install these dependancies before installing RRDTool.

For RedHat 9, you'll need to install the following RPMs from the RH9 CD:
  • libart_lgpl-2.3.11-2.i386.rpm
  • libart_lgpl-devel-2.3.11-2.i386.rpm
  • zlib-1.1.4-8.i386.rpm
  • zlib-devel-1.1.4-8.i386.rpm
  • libpng-1.2.2-16.i386.rpm
  • libpng-devel-1.2.2-16.i386.rpm
  • freetype-2.1.3-6.i386.rpm
  • freetype-devel-2.1.3-6.i386.rpm
You'll also need to install cgilib-devel, and a RH9 RPM for cgi-lib-devel can be found on the cgilib RPM packages page.

Each of the above RPMs can be installed using the following syntax:

rpm -Uvh rpmname.rpm


Installing RRDTool on Ubuntu
On Ubuntu distributions of linux, RRDTool can be installed by running the following:

sudo apt-get install librrds-perl rrdtool


Manually Installing RRDTool From Source
To manually install RRDTool from the source code, SCP the tarball into the /usr/src directory on your linux box. From a command prompt, change into the /usr/src directory, and un-tar the tarball:

cd /usr/src
tar -xzvf rrdtool-1.2.12.tar.gz

Change into the newly created directory:

cd rrdtool-1.2.12

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:

make site-perl-install


Creating Data Directories 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


What's Next?
RRDTool can be used to monitor other aspects of your linux box.

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.

References
About RRD Tool
RRD Tool Documentation


last updated 14 Nov 2016
 
.