1827723 Members
2705 Online
109968 Solutions
New Discussion

Using the sar command?

 
SOLVED
Go to solution
Shaun Aldrich_1
Advisor

Using the sar command?

Hello Everyone,

I keep trying to issue the sar command and receive the following message:-

root@viper:/var/adm/sa# sar -v

sar: Can't open /var/adm/sa/sa22

Anyone have any idea why I am getting this message? I did not think you had to do anything special in regards to setting up sar. Is this not a standard command?

Any help is greatly appreciated...
Hard work & dedication goes a long way...
1 REPLY 1
Alan Riggs
Honored Contributor
Solution

Re: Using the sar command?

When you issue the sar command without specifying an interval and/or number of measurements it assumes that you want to query the sar history files, which live in /var/adm/sa. These files are not created by default. You must create root cron jobs to collect and format the data properly. Man sar, sa, sa1, sa2 will give you more information. The period of cron jobs will vary depending upon the granularity you decide is appropriate. An example is below:

#
# Caputure system data for sar
#
0 * * * 0,6 /usr/lbin/sa/sa1 1200 3
0 8-17 * * 1-5 /usr/lbin/sa/sa1 900 4
0 18-7 * * 1-5 /usr/lbin/sa/sa1 1200 3
45 23 * * 1-5 /usr/lbin/sa/sa2 -s 0:00 -e 23:30 -i 3600 -A
15 6 * * * find /var/adm/sa -name 'sa*' -mtime +7 -exec rm {} \; > /dev/null 2>&1