sar tool

Christofer C. Bell christofer.c.bell at
Sat Dec 17 00:40:20 UTC 2005

On 12/16/05, Chasecreek Systemhouse <chasecreek.systemhouse at> wrote:
> On 12/15/05, Al Sparks <data345 at> wrote:
> > I'm running RHES 4.  I installed sysstat 5.0.5-1 using up2date.
> > However, when I run sar, it's showing all zeros regarding disk
> > activity.  Other gnome tools do show disk activity.
> >
> > Is there a problem out there with that tool not working with the 2.6
> > kernel?
> If your system is mostly idle then there may not be any sar activity
> to report for disk processes.

If sar is called without any arguments, it will try to read
/var/log/sa/sarXX and /var/log/sa/saXX where XX is the current day of
the month.  You'll need to initialize these files yourself after
installing sar (or allow the rpm provided cron entry to do it for
you).  In order to get sar output without these accounting files in
place, you need to tell sar at what interval in seconds you want
output, and how many interrations you want output for.  Eg;

[cbell at circe ~]$ sar 1 5
Linux 2.6.14-1.1644_FC4 (      12/16/2005

06:32:11 PM       CPU     %user     %nice   %system   %iowait     %idle
06:32:12 PM       all      0.99      0.00      0.00      0.00     99.01
06:32:13 PM       all      0.00      0.00      0.00      0.00    100.00
06:32:14 PM       all      0.00      0.00      0.00      0.00    100.00
06:32:15 PM       all      0.00      0.00      0.99      0.00     99.01
06:32:16 PM       all      0.00      0.00      0.00      0.00    100.00
Average:          all      0.20      0.00      0.20      0.00     99.60
[cbell at circe ~]$

Installing the sar package drops a file in /etc/cron.d called sysstat
that collects performance data every 10 minutes and records it in the
/var/log/sa accounting files.  The link provided by Thomas Springer is
a really good basic overview of sar, and how to initialize those
accounting files:

The commands that initialize (and use) the accounting files are
actually what's being run out of that crontab file that the sysstat
package installs for you, so once you install it, you can wait 10
minutes or a day or whatever and get the information you're looking
for from "sar without any arguments."

To be honest, I've yet to determine what, exactly, the
/etc/init.d/sysstat init script does that's also installed by the
sysstat package.  It seems to create a /var/log/sa/sa file that's
never touched again.  In looking at the file, it doesn't run any
daemon, either.

Anyway, best of luck!


"I trust the Democrats to take away my money, which I can afford.  I
trust the Republicans to take away my freedom, which I cannot."

More information about the fedora-list mailing list