24

I have:

mona@pascal:~$ cat /etc/default/sysstat
#
# Default settings for /etc/init.d/sysstat, /etc/cron.d/sysstat
# and /etc/cron.daily/sysstat files
#

# Should sadc collect system activity informations? Valid values
# are "true" and "false". Please do not put other values, they
# will be overwritten by debconf!
ENABLED="true"

and then:

mona@pascal:~$ sudo sar -d
Cannot open /var/log/sysstat/sa20: No such file or directory
Please check if data collecting is enabled in /etc/default/sysstat

Can you please suggest a fix?

Ubuntu 14.04
Mona Jalal
  • 4,545
  • 21
  • 68
  • 99

3 Answers3

48

Open /etc/default/sysstat using your favorite file editor and change ENABLED="false" to ENABLED="true"

vi /etc/default/sysstat
----
# Should sadc collect system activity informations? Valid values
# are "true" and "false". Please do not put other values, they
# will be overwritten by debconf!
ENABLED="true"
----

Restart sysstat: sudo service sysstat restart

and now here you are!

Ravexina
  • 55,668
  • 25
  • 164
  • 183
Bibin Joseph
  • 589
  • 4
  • 3
4

For fresh installations (2022+): if you use systemd, do NOT edit /etc/default/sysstat, it won't work.

You must use dpkg:

dpkg-reconfigure sysstat

and select «Yes».

As the cron will check for systemd, if it exists it will silently fail. Using dpkg-reconfigure will enable systemd tasks:

  • sysstat-collect
  • sysstat-summary

that would run as expected every 10 min.

Yvan
  • 151
  • 2
0

This enabled and started it:

sudo sed -i "s|ENABLED="false"|ENABLED="true"|g" /etc/default/sysstat
sudo systemctl enable sysstat && sudo systemctl start sysstat

Had to wait like 15 min. to see newly recorded values in sar command output.

16851556
  • 561