Linux Inspirations

Installing RRDTool

Posted on: 5 Juni, 2007

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

Background
Once I was 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
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.

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
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

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

Source – http://martybugs.net/linux/rrdtool/

1 Response to "Installing RRDTool"

I need to install RRDTool but i dont have root access. So i cant do yum for the dependencies.

Have you ever tried mannually giving the path of the dependencies?
I am trying to do this by setting the LDFLAPGS and the CPPFLAGS variables but it still doesnt seem to find the dependencies.

Any Ideas?

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

ABout Me!


WordPress ini sengaja saya buat untuk menulis apa yang telah saya lakukan agar saya selalu ingat, tulisan yang saya buat kebanyakan dalam bentuk tutorials configurasi linux dari hasil uji coba saya dan sebahagian di kutip dari beberapa website lain yang saya anggap perlu untuk saya tulis disini. Mudah-mudahan tutorial yang saya buat ini berguna buat pencinta linux yang lain. Salam Sejahtera.

Blog Stats

  • 120,467 hits

Linux Inspiration

%d blogger menyukai ini: