SUMMARY:Graphical output from SAR.

Clarkson, Michael (clarkson@amgen.com)
Wed, 08 Apr 1998 08:58:04 -0700

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

Thanks to:
David Thorburn-Gundlach [david@bae.uga.edu] 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 www.sarcheck.com; 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...

:-D
--=20

Rachel Polanskis [rachel@nepean.uws.edu.au] replyed:

Have a look at http://scholar.nepean.uws.edu.au/cgi-bin/Sarplot
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=20
a restricted release.

rachel

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 http://www.dc.net/efinch along
with some other goodies. The dimensions of the graphs are among the
configurable options.

Regards,
Ed

Jim Robertori [jimr@lucent.com] replyed:

Mike:

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

Hope this is helpful.

Special thanks to Oddbjxrn Steffensen [oddbjorn@oddbjorn.bdc.no] 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=20
mangle it at will.

regards,
-oddbjorn

#!/bin/ksh
# Oddbj=F8rn Steffensen

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

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

generate_gif() {
/heim/ad61967/bin/gnuplot > $BASEPATH/$HOSTNAME.$DATE.gif <<EOF=20
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=3D`date +%y%m%d`
HOSTNAME=3D`hostname`
generate_gif;
else
echo $i
/usr/bin/sar -f $i > $TMP_FILENAME

DATE=3D$i
HOSTNAME=3Dunknown
generate_gif;
# done
fi

#
------------------------------------------------------------------------
# Oppdater index-fil
#=20

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

rm -f $TMP_FILENAME
rm -f $TMP_FILENAME2