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
1
  • 1
    Did you run sudo service sysstat start afterwards?
    – heemayl
    Oct 27, 2016 at 23:09

3 Answers 3

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!

3
  • 9
    o.m.g....... why would it not be enabled by default? Now that I need it that history, I find that it hasn't been collecting it for me. Past CPU and memory usage has been lost to the wind. Argh. Jul 5, 2018 at 20:43
  • Unbelievable that this is not enabled by default. May 25, 2022 at 19:41
  • This should be the accepted answer.
    – Kipras
    Sep 20, 2022 at 9:10
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.

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .