我遇到了 SAR 未填充其应执行的 10 分钟间隔运行的每日日志的问题。我在多台服务器上有相同的配置,并且它们运行 sar 得很好。以下是设置示例:
-CentOS 6 -sysstat 9.0.4
# sysstat-9.0.4 configuration file.
# How long to keep log files (in days).
# If value is greater than 28, then log files are kept in
# multiple directories, one for each month.
HISTORY=28
# Compress (using gzip or bzip2) sa and sar files older than (in days):
COMPRESSAFTER=31
# Parameters for the system activity data collector (see sadc manual page)
# which are used for the generation of log files.
SADC_OPTIONS="-S DISK"
# Compression program to use.
ZIP="bzip2"
# cat /etc/crond./sysstat
# Run system activity accounting tool every 10 minutes
*/5 * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A
这是工作服务器的文件输出,如下所示:
-rw-r--r-- 1 root root 784968 Aug 1 23:55 sa01
-rw-r--r-- 1 root root 703111 Aug 2 23:53 sar02
-rw-r--r-- 1 root root 785016 Aug 2 23:55 sa02
-rw-r--r-- 1 root root 685031 Aug 3 23:53 sar03
-rw-r--r-- 1 root root 761928 Aug 3 23:55 sa03
-rw-r--r-- 1 root root 711740 Aug 4 22:20 sa04
这是问题服务器的输出(这些文件也很小,没有信息):
-rw-r--r-- 1 root root 504 Dec 21 2020 sa21
-rw-r--r-- 1 root root 504 Oct 20 2021 sa20
-rw-r--r-- 1 root root 504 Jul 14 21:11 sa14
-rw-r--r-- 1 root root 504 Jul 26 20:53 sa26
-rw-r--r-- 1 root root 504 Aug 4 22:04 sa04
我还尝试停止/启动 sysstat 并杀死 /usr/local/netsnmp/netsnmp_base/sbin/snmpd 的 pid。似乎什么都不起作用。任何帮助将不胜感激!
答案1
重新安装 sysstat 解决了该问题。