Install SysStat
# yum -y install sysstat
# systemctl start sysstat
# systemctl enable sysstat
Check the status of SysStat
# systemctl status sysstat
Add SysStat into a Cron Job
# cat /etc/cron.d/sysstat
# Run system activity accounting tool every 10 minutes
*/10 * * * * 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
Settings of SysStat
/etc/sysconfig/sysstat
# sysstat-10.1.5 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
# which are used for the generation of log files
# *note
SADC_OPTIONS=”-S DISK”
# *note : valid options
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)