sysstat: No such file or directory

sysstat: No such file or directory

Problem

When you run sysstat you might get the error

Cannot open /var/log/sysstat/sa20: No such file or directory

This is because sar logging is not enabled on the server yet.

Solution

Enable logging by running the following command

dpkg-reconfigure sysstat

Select <Yes> and press return.

sysstat

Manual Method

If this does not work change the config file manually
edit the file

vi /etc/default/sysstat

alter the line ENABLED from false to true

ENABLED="false"
ENABLED="true"

Restart sysstat

/etc/init.d/sysstat restart

Wait 10 minutes and try the command again and you will now get an output

[[email protected] ~]$ sar
Linux 2.6.26-2-686-bigmem (server.workgroup)    05/02/13        _i686_

00:00:01        CPU     %user     %nice   %system   %iowait    %steal     %idle
00:05:00        all      0.96      0.08      0.56      0.08      0.00     98.32
00:10:01        all      0.95      0.02      0.42      0.01      0.00     98.61
00:15:00        all      1.00      0.00      0.39      0.00      0.00     98.61
00:20:01        all      0.94      0.00      0.38      0.00      0.00     98.68
00:25:00        all      0.93      0.00      0.43      0.00      0.00     98.64
00:30:00        all      0.96      0.00      0.43      0.00      0.00     98.61
00:35:01        all      0.95      0.00      0.39      0.00      0.00     98.65