Ubuntu安装sysstat

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

最近接触的某个国产OS,是基于Ubuntu的。

习惯了使用sysstat,顺手通过apt-get install sysstat 安装了。在执行sar的时候却报错:

root@localhost:/etc/cron.d# sar
无法打开 /var/log/sysstat/sa03: 没有那个文件或目录
请检查是否允许数据收集

关键是在第二行的提示,默认安装后,sysstat采集信息是关闭的,需要打开:

root@localhost:/etc/cron.d# vi /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"

enbled 改成true后,重启sysstat服务:systemctl restart sysstat

再次执行sar,不报错了。

跟centos不同的是,有个配置选项来控制是否允许采集,且默认为false。

转载于:https://my.oschina.net/yafeishi/blog/1922209

你可能感兴趣的:(Ubuntu安装sysstat)