无法打开 /var/log/sysstat/sa20: 没有那个文件或目录

Mon*_*lal 12 14.04

我有:

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"
Run Code Online (Sandbox Code Playgroud)

进而:

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
Run Code Online (Sandbox Code Playgroud)

你能建议修复吗?

Ubuntu 14.04
Run Code Online (Sandbox Code Playgroud)

小智 29

/etc/default/sysstat使用您喜欢的文件编辑器打开并更改ENABLED="false"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"
----
Run Code Online (Sandbox Code Playgroud)

重新启动系统统计: sudo service sysstat restart

现在你来了!

  • 天啊……为什么不默认开启?现在我需要它的历史,我发现它并没有为我收集它。过去的 CPU 和内存使用量已随风而逝。啊。 (7认同)