RHEL 9でSysstatの設定を確認します。
Sysstatのデータ保存に関する設定を確認する!
Sysstatのデータ保存に関する設定は、「/etc/sysconfig/sysstat」を確認します。ファイルの保存先が「/var/log/sa」で、圧縮方法が「xz」であることなどがわかります。
$ cat /etc/sysconfig/sysstat # sysstat-12.5.4 configuration file. # How long to keep log files (in days). # If value is greater than 28, then use sadc's option -D to prevent older # data files from being overwritten. See sadc(8) and sysstat(5) manual pages. HISTORY=28 # Compress (using xz, 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" # Directory where sa and sar files are saved. The directory must exist. SA_DIR=/var/log/sa # Compression program to use. ZIP="xz" # By default sa2 script generates yesterday's summary, since the cron job # usually runs right after midnight. If you want sa2 to generate the summary # of the same day (for example when cron job runs at 23:53) set this variable. #YESTERDAY=no # By default sa2 script generates reports files (the so called sarDD files). # Set this variable to false to disable reports generation. #REPORTS=false # Tell sa2 to wait for a random delay in the range 0 .. ${DELAY_RANGE} before # executing. This delay is expressed in seconds, and is aimed at preventing # a massive I/O burst at the same time on VM sharing the same storage area. # Set this variable to 0 to make sa2 generate reports files immediately. DELAY_RANGE=0 # The sa1 and sa2 scripts generate system activity data and report files in # the /var/log/sa directory. By default the files are created with umask 0022 # and are therefore readable for all users. Change this variable to restrict # the permissions on the files (e.g. use 0027 to adhere to more strict # security standards). UMASK=0022
Sysstatのデータ取得タイミングの設定を確認する!
Sysstatのデータ取得タイミングの設定は、「/lib/systemd/system/sysstat-collect.timer」を確認します。以下の内容から10分おきに取得していることがわかります。
$ cat /lib/systemd/system/sysstat-collect.timer # /usr/lib/systemd/system/sysstat-collect.timer # (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl> # # sysstat-12.5.4 systemd unit file: # Activates activity collector every 10 minutes [Unit] Description=Run system activity accounting tool every 10 minutes [Timer] OnCalendar=*:00/10 [Install] WantedBy=sysstat.service
おわりに
RHEL 9のSysstatの設定は、「/etc/sysconfig/sysstat」を確認します。sarコマンドで、過去分のデータを表示する場合にも確認が必要になります。
関連記事
関連書籍(Amazon)