Solved

sysstat not recording historical disk stats

Posted on 2009-03-29
8
4,424 Views
Last Modified: 2013-12-16
Hi All,

Anyone come across the following;

I'm looking at disk stats using sar, if I run `sar -d 5 1` I get the following (trimmed) output.

   Linux 2.6.18-92.1.22.el5         03/29/2009

   05:38:59 PM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
   05:39:04 PM    dev8-0      1.20      0.00     28.80     24.00      0.01      5.17      5.17      0.62
   05:39:04 PM   dev8-16      1.20      0.00     28.80     24.00      0.01      8.50      8.50      1.02
   05:39:04 PM    dev9-1      2.80      0.00     22.40      8.00      0.00      0.00      0.00      0.00
   05:39:04 PM    dev9-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

   Average:          DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
   Average:       dev8-0      1.20      0.00     28.80     24.00      0.01      5.17      5.17      0.62
   Average:      dev8-16      1.20      0.00     28.80     24.00      0.01      8.50      8.50      1.02

All seems well so far, however, if I want to look at historical disk stats I type `sar -d -f /var/log/sa/sa28` for example but I get:-
   # sar -d -f /var/log/sa/sa28
   Requested activities not available in file

The cron job runs `sa2 -A` which should record the disk information.

Is there a bug in sysstat? I can't seem to find anything on the net about it...


O/S Centos 5.2 (updated)
sysstat = sysstat-7.0.2-1.el5



0
Comment
Question by:jools
  • 6
  • 2
8 Comments
 
LVL 7

Accepted Solution

by:
martin_2110 earned 500 total points
Comment Utility
There is no bug it is turned off by default.
You need to insert  "-d"  to the follwing lines in /usr/lib64/sa/sa1 (or /usr/lib/sa/sa1) on a 32 bit system
        exec ${ENDIR}/sadc -d -F -L 1 1 -
        exec ${ENDIR}/sadc -d -F -L $* -

You also need to empty the current days database file /var/log/sa28 (<- day of the month)
the next time sar runs you should be able to run sar -d
0
 
LVL 19

Author Comment

by:jools
Comment Utility
According to the man page, -A includes the `d` option....
where did you get it was turned off by default btw?

0
 
LVL 7

Expert Comment

by:martin_2110
Comment Utility
0
 
LVL 19

Author Comment

by:jools
Comment Utility
It does not match the man page information;

OPTIONS
       -A     This is equivalent to specifying -bBcdqrRuvwWy -I SUM -I XALL -n ALL -P ALL.

The sa2 command is specified in the cron job with the -A which should include the `d` option.

Running `sar -A 5 5` from the command line produces all the disk output, when it is run from cron under sa2 it is not. The man page for sa2 says in the description that it uses all the flags and options of sar.


0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 19

Author Comment

by:jools
Comment Utility
:-|

oh dear......


I was looking at the wrong line in the cron.d file.... it seems I should have been looking at sa1 which runs every 10 minutes and sa1 is the equivalent of sadc which does, by default, ignore disk stats.

sa2 does summat else and I'm so annoyed I really can be bothered to type `man` again.....

I think I'm getting too old for this stuff...

Thx

J
0
 
LVL 19

Author Comment

by:jools
Comment Utility
Crontab added for future reference


# run system activity accounting tool every 10 minutes

*/10 * * * * root /usr/lib/sa/sa1 -d 1 1

# generate a daily summary of process accounting at 23:53

53 23 * * * root /usr/lib/sa/sa2 -A

Open in new window

0
 
LVL 19

Author Comment

by:jools
Comment Utility
upping points cos I can :-)
0
 
LVL 19

Author Closing Comment

by:jools
Comment Utility
Not exactly my fix but did make me think. Upped points for helpfulness, grade B because...well.... because I'm old and grumpy!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now