Ubuntu 24.04
Sponsored Link

SysStat : Install2024/05/28

 
Install SysStat to enable system monitoring like CPU usage or Network statics.
[1] Install SysStat.
root@dlp:~#
apt -y install sysstat
root@dlp:~#
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.
[2] System resource data are recorded every 10 minutes by default.
If you'd like to change the interval, it's possible to edit like follows.
# default setting is like follows

root@dlp:~#
grep -A 1 'Timer' /usr/lib/systemd/system/sysstat-collect.timer

[Timer]
OnCalendar=*:00/10
# to change the interval, set like follows

root@dlp:~#
systemctl edit sysstat-collect.timer
# for example, change to every 5 minutes

[Timer]
OnCalendar=
OnCalendar=*:00/5
[3] If you'd like to change some settings of SysStat, the configuration file is located like follows.
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 note
SADC_OPTIONS="-S DISK"

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)
Matched Content