我假设您已经正确安装了sysstat实用程序,
apt-get install sysstat
步骤1
使用您喜欢的文件编辑器打开“ /etc/default/sysstat ”并将ENABLED="false"更改为ENABLED="true"
vim /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"
----
第2步
将收集间隔从每 10 分钟更改为每 2 分钟。为了让我们每两分钟获取一次指标,您可以根据需要更改间隔。
----
vim /etc/cron.d/sysstat
Change
5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
To
*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
----
第 3 步
接下来我们需要重启sysstat服务。
service sysstat restart
Or
/etc/init.d/sysstat restart
供参考,您可以点击这里