Convert sar text output into RRDTool Graphs

 Background is a Perl script that can be used to generate RRDTool graphs from sar output.

It creates a PNG Graph for each statistics group collected by sar.
Version 2.6 handles Linux, HP-UX, AIX and Solaris sar output.
Each statistics of the group is represented as a single line in the graph.

Only the filename to parse is mandatory. This filename if produced by a command such as "sar -A -f filename"

Without any additional parameters, creates graphs for the period of time specified in the given filename.

Starting with the version 2.4, the script is able to concatenate data in an existing RRD file. It can truncate archives to a maximum size.

A new "companion" script : can generate graphs from existing RRD archives without re-parsing the "sar" data.

Before running the script, make sure the path to "rrdtool" command is correct.


  • Perl
  • rrdtool
  • Getopt::Std
  • Time::Local
  • Date::Calc


  • I get this error message:

    Argument "07-06-06" isn't numeric in integer ge (>=) at /usr/lib/perl5/5.8.8/Time/ line 103, <FD> line 5.

    This is probably because the date format in the SAR output is not the default month-day-year format. You should try the "-t DMY" option.

  • How do I concatenate data to an existing graph ?

    Imagine you run "sar" and get a single output file per day. The new -C option allows you to add new values to an existing RRD file.

  • Is there a way to limit the size of the RRD files when I use the concatenation ?

    Yes, you can add the -T #days option with the -C option.

  • Is there a way to generate new graphs without re-parsing the data ?

    Yes, you can. Since v2.4, the main script writes in a XML file, which contains all the necessary parameters to build new graphs with the same RRD files. The graphs can be rebuilt with the new script.

  • Is there a way to generate graphs with single indicators ?

    Yes, you can. The main script allows you to generate graphs with all or some of the indicators for the same "sar data block". Using the '-g' option, you can precisely choose what you want to generate...


VersionsDateArchiveMD5 checksum
2.6.2 05 Sep 2011 (Linux, HP-UX, AIX & Solaris) 4fd33a243ae11d4283e83f50d631c0e6 f000237f3687c233b7a7721f9c042dd0
2.6.1 23 Aug 2011 (Linux, HP-UX, AIX & Solaris) 58dfce22a71cfe3e3268b0b221144410 cd1b77ebd5c5234b4e599594889bf3c6
2.6 01 Aug 2011 (Linux, HP-UX, AIX & Solaris) f9eaeb820bd946a680e55ab5b453400c c622e8326b724a9e62dcd8b28589f6d1
2.5 15 Jun 2010 (Linux, HP-UX & Solaris) edbc29f61620afa8ca9c298cca23eba2 1374f9a1cb7786ea64815781345ee911
2.4d 06 Jun 2010 (Linux & Solaris) 663b60c642460f8563d415eef887f226
2.3 25 Oct 2008 (Linux & Solaris) 782f5adb30e06831cfd000d7fa69302f
2.2 25 Sep 2007 (Linux & Solaris) 51fda390599794bef44d529a34b5e524
2.1 21 Aug 2007 (Linux & Solaris) 7b1ca3797c94db90c50b79ff9c173dfb
2.0b 11 Jun 2007 (Linux & Solaris) 9afe57acf18fa9dbe1d3972d7ac3b96e
2.0a 10 May 2007 (Linux & Solaris) d80522f936b0b32bc5585159848a1cc8
2.0 26 Mar 2007 (Linux & Solaris) 3e40f6f99dbd19b0a84efcc3abb1c8e7
1.2 05 Feb 2007 (Linux) bb0103985647f1563cbaeaa51294d705
1.1 15 Jan 2007 (Linux) c41726ed384333885ccb49585852e857
1.0 30 Nov 2006 (Linux) 46681888a800ce1bc46b0e49eecbc356

Dagobert Michelsen has packaged sar2rrd for Solaris for OpenCSW.
You can download his package here

This site is maintained by