SUMMARY:Graphical output from SAR.

From: Clarkson, Michael (
Date: Wed Apr 08 1998 - 10:58:04 CDT

Thanks for all the responses, the general consensus suggested using
gnuplot in conjuction with perl to produce the output

Thanks to:
David Thorburn-Gundlach [] replyed:
Michael --

I haven't seen anything from sar that output graphs, but Concord's
NetHealth provides graphic info on your network and, by extension,
your machines.

Check out sarcheck at; they print out a text report
(which, at first glance, looks fairly detailed) and they pride
themselves on *not* just printing out graphs and letting you do the
analysis. Their code costs to license, but it looks interesting...



Rachel Polanskis [] replyed:

Have a look at and see ifthat is what you mean.

It's not 100% complete yet (haven't got time at present), but if it is what you want, I'll package it up for you and give you a restricted release.


Ed Finch [efinch@eos.EAST.HITC.COM] replyed:

Funny you should ask...I'm writing a perl script that I call sarge ("System Activity Reporter Graphing Engine") to do just that. I'm basically using "man sar" and the O'Reilly book "System Performance Tuning" and am graphing whatever looks useful. I've attached samples of the available graphs for your reference. Sarge should be complete within a week; I'll put the finished code at along with some other goodies. The dimensions of the graphs are among the configurable options.

Regards, Ed

Jim Robertori [] replyed:


I know I'm a bit late, but such is the life of a Unix Admin as you probably know. I am about to implement the same thing. What I'm going to do is manipulate various output files, one each for vmstat, mpstat, iostat, sar, etc into a format such that the date and time are on the left side and the values in quote delimited fields to the right. Then my plan is to use GNUplot to graph them, or even MS Excel.

Hope this is helpful.

Special thanks to Oddbjxrn Steffensen [] who included the following script:

I was in the same situation like you, peeked around, and didn't find anything that really did what I wanted to. So -- I hacked together this small script, which depends on gnuplot. This is _not_ very pretty, with hardcoded paths and so on, but at least it works for me. Feel free to mangle it at will.

regards, -oddbjorn

#!/bin/ksh # Oddbjørn Steffensen

BASEPATH=/heim/sysmgmt/sar ORIG_IFS=$IFS TMP_FILENAME=/tmp/`basename $0`.tmp.$$ TMP_FILENAME2=/tmp/`basename $0`.tmp2.$$

# ------------------------------------------------------------------------

generate_gif() { /heim/ad61967/bin/gnuplot > $BASEPATH/$HOSTNAME.$DATE.gif <<EOF set timefmt "%H:%M:%S" set yrange [ 0 : 100 ] set xdata time set xrange [ "00:00":"23:59" ] set format x "%H:%M:%S" set grid set title "$HOSTNAME $DATE" 0,0 set terminal gif small size 600,400 transparent xffffff x000000 x404040 xff0000 x00ff00 x0000ff x000000 set multiplot plot '$TMP_FILENAME' using 1:2 t 'usr%' with lines, '$TMP_FILENAME' using 1:3 t 'sys%' with lines, '$TMP_FILENAME' using 1:4 t 'wio%' with lines, '$TMP_FILENAME' using 1:5 t 'idle%' with lines EOF }

# ------------------------------------------------------------------------

if [ $# -eq 0 ]; then /usr/bin/sar > $TMP_FILENAME DATE=`date +%y%m%d` HOSTNAME=`hostname` generate_gif; else echo $i /usr/bin/sar -f $i > $TMP_FILENAME

DATE=$i HOSTNAME=unknown generate_gif; # done fi

# ------------------------------------------------------------------------ # Oppdater index-fil #

INDEX=$BASEPATH/$HOSTNAME.html echo "<html><title>SAR-grafer</title><body bgcolor=moccasin>" > $INDEX for i in *.gif do echo "<img src=\"`basename $i`\" width=600 height=400>" >> $INDEX done echo "</body></html>" >> $INDEX


This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:36 CDT