[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1389
  • Last Modified:

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?


0
jaxstorm
Asked:
jaxstorm
  • 6
  • 4
  • 2
  • +1
2 Solutions
 
woolmilkporcCommented:
Hi,

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

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

wmp
0
 
upanwarCommented:
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>
0
 
jaxstormAuthor Commented:
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



0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
robocatCommented:


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.
 
0
 
jaxstormAuthor Commented:
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?
0
 
jaxstormAuthor Commented:
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

0
 
woolmilkporcCommented:
Afaik you don't need /var/adm/sa with RedHat. It's /var/log/sa

>> they already exist in cron.d <<

That's why I asked for sysstat.

You could add >/tmp/sa1.log 2>&1 at the end of the sa1 line to check for possible error messages.

wmp
0
 
robocatCommented:

What happens if you run this manually ?


/usr/lib64/sa/sa1 1 1

Any errors ? Is sa11 being created in /var/log/sa ?

0
 
jaxstormAuthor Commented:
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?
0
 
robocatCommented:

check /var/log/cron for errors ?
0
 
jaxstormAuthor Commented:
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

0
 
robocatCommented:

Check for appropriate (execute) permissions on that file.
0
 
jaxstormAuthor Commented:
Way ahead of you RC, thanks guys you all contributed :)
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 6
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now