Solved

sysstat not recording historical disk stats

Posted on 2009-03-29
8
4,469 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
ID: 24016349
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
ID: 24018474
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
ID: 24022789
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 19

Author Comment

by:jools
ID: 24023782
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
 
LVL 19

Author Comment

by:jools
ID: 24023828
:-|

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
ID: 24023837
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
ID: 24023857
upping points cos I can :-)
0
 
LVL 19

Author Closing Comment

by:jools
ID: 31564068
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux VM 6 101
Can't ping New Linux Servers 40 89
Rebooted a CentOS 7 server and it wouldn't boot into the later Core version 5 75
linux SFTP 8 59
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

792 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