• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1267
  • Last Modified:

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

Hi,

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 ?
0
anshuma
Asked:
anshuma
4 Solutions
 
farzanjCommented:
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.

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

My vesrion is
sysstat-7.0.2-3.el5.x86_64

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.
0
 
NopiusCommented:
>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 {
  missingok
  daily
  rotate 1095
  compress
}

Open in new window



Regards,
Arty
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
joolsCommented:
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.
#!/bin/sh
# /usr/lib/sa/sa1.sh
# (C) 1999-2006 Sebastien Godard (sysstat <at> wanadoo.fr)
#
umask 0022
ENDIR=/usr/lib/sa
cd ${ENDIR}
if [ $# = 0 ]
then
# 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 -
else
        exec ${ENDIR}/sadc -d -F -L $* -
fi

Open in new window

0
 
joolsCommented:
forgot to mention, you probably need to restart sysstat;

# service sysstat restart
0
 
anshumaEngineeringAuthor Commented:
thank you experts
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now