SysStat : インストール2025/09/18 |
|
SysStat をインストールしてシステムの様々な情報を取得できるようにします。 |
|
| [1] | SysStat をインストールします。 |
|
root@dlp:~#
root@dlp:~# apt -y install sysstat systemctl enable --now sysstat Synchronizing state of sysstat.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install enable sysstat Created symlink '/etc/systemd/system/multi-user.target.wants/sysstat.service' → '/usr/lib/systemd/system/sysstat.service'. Created symlink '/etc/systemd/system/sysstat.service.wants/sysstat-collect.timer' → '/usr/lib/systemd/system/sysstat-collect.timer'. Created symlink '/etc/systemd/system/sysstat.service.wants/sysstat-summary.timer' → '/usr/lib/systemd/system/sysstat-summary.timer'. Created symlink '/etc/systemd/system/sysstat.service.wants/sysstat-rotate.timer' → '/usr/lib/systemd/system/sysstat-rotate.timer'. |
| [2] | システムリソースの情報はデフォルトで 10 分間隔で取得されます。 取得間隔を変更したい場合は以下のように変更可能です。 |
|
# デフォルトの取得間隔は以下の設定による root@dlp:~# grep -A 1 'Timer' /usr/lib/systemd/system/sysstat-collect.timer [Timer] OnCalendar=*:00/10 # 設定を追記してデフォルトをオーバーライド # 例として 5 分間隔に変更 [Timer] OnCalendar=*:00/5 |
| [3] | ログの保管期間等を変更する場合は以下のファイルに設定します。 |
|
root@dlp:~#
vi /etc/sysstat/sysstat # sysstat configuration file. See sysstat(5) manual page. # How long to keep log files (in days). # Used by sa2(8) script # If value is greater than 28, then log files are kept in # multiple directories, one for each month. # ログの保管期間 (日数) HISTORY=7 # Compress (using gzip or bzip2) sa and sar files older than (in days): # 指定日数より古いログは圧縮する COMPRESSAFTER=10 # Parameters for the system activity data collector (see sadc(8) manual page) # which are used for the generation of log files. # By default contains the `-S DISK' option responsible for generating disk # statisitcs. Use `-S XALL' to collect all available statistics. # デフォルトでは取得されない設定となっている情報を追加取得するオプション *1 SADC_OPTIONS="-S DISK" # *1 指定可能なオプション INT ⇒ System Interrupts DISK ⇒ Block Devices SNMP ⇒ SNMP statistics IPV6 ⇒ IPv6 statistics POWER ⇒ Power Management statistics ALL ⇒ All of the above XDISK ⇒ DISK + Partition statistics XALL ⇒ All of the above (ALL + XDISK) |
| Sponsored Link |
|
|