Getting Started with RRDtool

Cuddletech TekRef Series

Ben Rockwood

Cuddletech
Revision History
Revision v1.0April 27th 2004benr
Initial Document
Revision v1.1May 10th 2004benr
Final sections added

Abstract

RRDtool is a powerful replacement for MRTG, but it's complicated and extremely confusing the first time you use it. This paper hopes to make your first experience a little less mind numbing.


Table of Contents

Introduction
Creating an initial RRD
Adding Timed Data
Generating Graphs
Another look, start to finish
Viewing Historical Data
Conclusions

Introduction

RRDtool was written by Tobi Oetiker, the author of MRTG. It is, effectively, the next generation of MRTG, with a complete reimplementation of MRTGs graphing and logging features. MRTG works great for simple network monitoring, but thats really all it was originally intended to do. These days people are using MRTG to monitor everything from router bandwidth, to memory and disk statistics, to the number of times the dog goes in and out of the house.

There are a number of drawbacks to MRTG however. On the graphing front, MRTG graphs always use a Y axis starting at 0, if you only want to see the relevant values in a range (for temps you might only want to graph from 50F to 90F) your out of luck. You are significantly limited to the number of different values that can be graphed, if you want to see the network throughput of 10 different servers your probably going to be forced to use 10 different graphs. The list goes on and on. The point is that RRDtool fills in the gaps that MRTG leaves wanting, and provides for open customization that was difficult if not impossible before.

But, MRTG has one thing that RRDtool doesn't... simplicity. Many Network Admins who know more about air purifiers than UNIX systems are using MRTG on a regular basis, thanks to tools like cfgmaker and indexmaker, coupled with a simple and basically straightforward config syntax. RRDtool isn't quite so simple though, at least at first. Almost all functions are provided by a single tool: rrdtool. The same program is used to create databases, modify, tune and update them, generate graphs, and even make backup dumps.

Lets look at the basic flow you follow when using RRDtool:

Overview of steps to use RRDtool for data graphing

  1. Create an empty RRD database using rrdtool create.

  2. Utilize a script and/or the cron to add data to the database using rrdtool update.

  3. Generate, usually via script, custom output graphs using rrdtool graph.

In this tutorial we'll look quickly at each step, so that you can get off and generating your own output.