issues with sar command on Red Hat Enterprise Linux Server release 5.3 (Tikanga)

Posted on 2011-04-19
Last Modified: 2013-12-16

when I run the sar command I get the following

[root@xxxx ~]# sar -d
Requested activities not available in file

but sar -d 5 1 works

what's the difference in these options

Also instead of just one month of sar files how can I have 3 years of sar files ?
Question by:anshuma
    LVL 31

    Accepted Solution

    It is version specific.  Newer version work differently.

    On RHEL4, sar -d gave the entire data plus the averages.
    On the newer versions, you have to give the number of iterations and time between iterations.

    Now if you do

    sar -d <Time In Seconds> <Number of Iterations>

    This would show you data and then average in the last iteration.

    You need to have data in your sar logs for 3 years to be able to see it.
    It mostly logs in /var/log/sa/ folder.  You can check how far it goes in your system.

    LVL 38

    Assisted Solution

    Which sar version do you use?
    $ rpm -q sysstat

    My vesrion is

    and I kept one month of data and
    # sar -d
    # sar -d 5 1
    all works for me.

    You might want to upgrade sysstat package first.
    LVL 27

    Assisted Solution

    >Also instead of just one month of sar files how can I have 3 years of sar files ?

    Start logging your data and keep it for next 3 years...

    Say, run this command (it runs continuously) from one of rc.d scripts:
    sar -o /var/log/sa/sar.log -d 5 0 > /dev/null

    then rotate log file (create /etc/logrotate.d/sa) with the following lines:

    /var/log/sa/sar.log {
      rotate 1095

    Open in new window

    LVL 19

    Assisted Solution

    You have to configure sar to log device data, it doesnt do it in the base configs.

    sar -d 5 1 works because you're running it from the command line, not trying to extract the archive information from the collected data.

    The cron entries in /etc/cron.d (at least on my system) use sa1 and sa2
    If you want to add -d logging, edit /usr/lib/sa/sa1 and add it to the exec code, see below.
    # /usr/lib/sa/
    # (C) 1999-2006 Sebastien Godard (sysstat <at>
    umask 0022
    cd ${ENDIR}
    if [ $# = 0 ]
    # Note: Stats are written at the end of previous file *and* at the
    # beginning of the new one (when there is a file rotation) only if
    # outfile has been specified as '-' on the command line...
            exec ${ENDIR}/sadc -d -F -L 1 1 -
            exec ${ENDIR}/sadc -d -F -L $* -

    Open in new window

    LVL 19

    Expert Comment

    forgot to mention, you probably need to restart sysstat;

    # service sysstat restart

    Author Closing Comment

    thank you experts

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    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.

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now