Avatar of jaxstorm
jaxstormFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Sar error

When trying to run Sar command error


 sar
Cannot open /var/log/sa/sa11: No such file or directory

Open in new window


Running:

cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

Open in new window


How can I create all log files needed /var/log/sa/saXX - is a cron job required?


LinuxUnix OSLinux Distributions

Avatar of undefined
Last Comment
jaxstorm
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Hi,

do you have the "sysstat" script in /etc/cron.d?

What's in /var/log/sa anyway?

wmp
Avatar of upanwar
upanwar
Flag of India image

If you just give the command 'sar' then sar searches for the current day's file in /var/adm/sa directory. If you want the current stats from sar, you have to provide the appropriate switch (such as -d for disk info, -u for cpu util and so on), the sampling interval and the number of samples.

Try:

sar -mu -P ALL <Intervals> <No. of samples>
Avatar of jaxstorm
jaxstorm
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

systat does exist in /etc/cron.d

ll /var/log/sa
total 16
-rw-r--r--  1 root root 528 Oct  3  2007 sa03
-rw-r--r--  1 root root 528 Feb 19  2008 sa19
-rw-r--r--  1 root root 528 Sep 24 15:30 sa24
-rw-r--r--  1 root root 816 May 25  2010 sa25

Open in new window



Avatar of robocat
robocat



Put these into your crontab

*/10 * * * * root /usr/lib/sa/sa1 1 1
59 23 * * * root /usr/lib/sa/sa2 -A

They will collect the data in the sa directory, needed by sar.
 
Avatar of jaxstorm
jaxstorm
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

upanwar:

While I know you're correct, surely the /var/log/sa directory should be populated for for sa11 given that the cron job exists and the system has been up for 100+ days?

Fwiw, /var/adm/sa does not exist, would making that directory rectify the problem?
Avatar of jaxstorm
jaxstorm
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

robocat, they already exist in cron.d

cat /etc/cron.d/sysstat
# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib64/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of robocat
robocat

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of jaxstorm
jaxstorm
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Running /usr/lib64/sa/sa1 1 1 manually seems to have created the file correctly so I think the issue must be with the cron job. Any ideas?
Avatar of robocat
robocat


check /var/log/cron for errors ?
Avatar of jaxstorm
jaxstorm
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

This doesn't look good

less /var/log/cron | grep sysstat
Feb 11 06:53:01 ana0dl-a0018s00 crond[4831]: (*system*) BAD FILE MODE (/etc/cron.d/sysstat)

Open in new window

Avatar of robocat
robocat


Check for appropriate (execute) permissions on that file.
Avatar of jaxstorm
jaxstorm
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Way ahead of you RC, thanks guys you all contributed :)
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo