Solved

sysstat not recording historical disk stats

Posted on 2009-03-29
8
4,444 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
 
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can i set a Environment Variable in my Unix script ? 3 51
linux installs 6 49
Why isn't object file created? 6 42
Need BIOS update Linux for MSI X99A motherboard. 4 30
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

920 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

15 Experts available now in Live!

Get 1:1 Help Now