Systemd is manager of everything in Linux.
systemctl is the main management tool (give order, ask questions) for systemd.
Unit is a configuration text file that defines how process work.
Timer is a unit file ending in .timer that acts as an alarm clock.
Exp: Task scheduling & alarm execution
.timer will trigger corresponding .service file when a time threshold or event is reached.
logrotate is package (similar software in Windows OS) in Linux.
Log files generated by the system and running applications continue to grow over time.
logrotate prevents this issue by periodically renames existing active log files, automatically compresses rotated historical log files etc.
systemd executes the logrotate command.
The logrotate.timer triggers logrotate.service once per day to clean up and rotates the logs.
Refer to 42 - logrotate for tutorial.
sysstat is package (similar software in Windows OS) in Linux.
It collects, records, and analyzes real-time and historical system performance metrics.
The sysstat-collect.timer triggers sysstat-collect.service every 10 minutes to capture snapshot system performance metrics.
Tutorial
Install sysstat
dnf install -y sysstat
Checks sysstat units files
systemctl list-unit-files sysstat*
Enable timer
sudo systemctl enable --now [Timer Unit].timer
Example: sudo systemctl enable --now sysstat-collect.timer
Displays the status of the timer
systemctl status [Timer Unit].timer
Example: systemctl status sysstat-collect.timer
Trigger the service now
sudo systemctl start [Timer Unit].service
Example: sudo systemctl start sysstat-collect.service
sar (System Activity Reporter) displays CPU usage, memory utilization, network statistics, and I/O metrics.
sar -A
Displays the status of the sysstat-collect.service
systemctl status sysstat-collect.service
Check the configuration of the sysstat-collect.service
systemctl cat sysstat-collect.service
Displays the status of the sysstat-collect.timer
systemctl status sysstat-collect.timer
Check the configuration of the sysstat-collect.timer
systemctl cat sysstat-collect.timer
Result
student@localhost:~$ sudo dnf install -y sysstat
[sudo] password for student:
Updating Subscription Management repositories.
Last metadata expiration check: 0:43:08 ago on Tue 01 Sep 2026 04:06:39 PM +08.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
sysstat x86_64 12.7.6-4.el10 rhel-10-for-x86_64-appstream-rpms 532 k
Installing dependencies:
lm_sensors-libs x86_64 3.6.0-20.el10 rhel-10-for-x86_64-appstream-rpms 43 k
pcp-conf x86_64 7.0.3-5.el10_2 rhel-10-for-x86_64-appstream-rpms 37 k
pcp-libs x86_64 7.0.3-5.el10_2 rhel-10-for-x86_64-appstream-rpms 802 k
Transaction Summary
=============================================================================================================================================================
Install 4 Packages
Total download size: 1.4 M
Installed size: 4.2 M
Downloading Packages:
(1/4): lm_sensors-libs-3.6.0-20.el10.x86_64.rpm 55 kB/s | 43 kB 00:00
(2/4): pcp-conf-7.0.3-5.el10_2.x86_64.rpm 36 kB/s | 37 kB 00:01
(3/4): sysstat-12.7.6-4.el10.x86_64.rpm 352 kB/s | 532 kB 00:01
(4/4): pcp-libs-7.0.3-5.el10_2.x86_64.rpm 377 kB/s | 802 kB 00:02
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 485 kB/s | 1.4 MB 00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : pcp-conf-7.0.3-5.el10_2.x86_64 1/4
Installing : pcp-libs-7.0.3-5.el10_2.x86_64 2/4
Installing : lm_sensors-libs-3.6.0-20.el10.x86_64 3/4
Installing : sysstat-12.7.6-4.el10.x86_64 4/4
Running scriptlet: sysstat-12.7.6-4.el10.x86_64 4/4
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'.
Installed products updated.
Installed:
lm_sensors-libs-3.6.0-20.el10.x86_64 pcp-conf-7.0.3-5.el10_2.x86_64 pcp-libs-7.0.3-5.el10_2.x86_64 sysstat-12.7.6-4.el10.x86_64
Complete!
student@localhost:~$ systemctl list-unit-files sysstat*
UNIT FILE STATE PRESET
sysstat-collect.service static -
sysstat-rotate.service static -
sysstat-summary.service static -
sysstat.service enabled enabled
sysstat-collect.timer enabled enabled
sysstat-rotate.timer enabled disabled
sysstat-summary.timer enabled enabled
7 unit files listed.
student@localhost:~$ systemctl start sysstat-collect.service
student@localhost:~$ sar -A
Linux 6.12.0-211.43.1.el10_2.x86_64 (localhost.localdomain) 09/01/2026 _x86_64_ (2 CPU)
05:00:50 PM CPU %usr %nice %sys %iowait %steal %irq %soft %guest %gnice %idle
05:02:23 PM all 0.79 0.00 1.40 0.02 0.00 2.25 0.50 0.00 0.00 95.04
05:02:23 PM 0 1.10 0.00 1.30 0.01 0.00 2.44 0.60 0.00 0.00 94.55
05:02:23 PM 1 0.48 0.00 1.50 0.02 0.00 2.06 0.40 0.00 0.00 95.54
Average: CPU %usr %nice %sys %iowait %steal %irq %soft %guest %gnice %idle
Average: all 0.79 0.00 1.40 0.02 0.00 2.25 0.50 0.00 0.00 95.04
Average: 0 1.10 0.00 1.30 0.01 0.00 2.44 0.60 0.00 0.00 94.55
Average: 1 0.48 0.00 1.50 0.02 0.00 2.06 0.40 0.00 0.00 95.54
05:00:50 PM proc/s cswch/s
05:02:23 PM 0.86 500.82
Average: 0.86 500.82
05:00:50 PM pswpin/s pswpout/s
05:02:23 PM 0.00 0.00
Average: 0.00 0.00
05:00:50 PM pgpgin/s pgpgout/s fault/s majflt/s pgfree/s pgscank/s pgscand/s pgsteal/s pgprom/s pgdem/s
05:02:23 PM 0.47 12.00 775.52 0.01 345.98 0.00 0.00 0.00 0.00 0.00
Average: 0.47 12.00 775.52 0.01 345.98 0.00 0.00 0.00 0.00 0.00
05:00:50 PM tps rtps wtps dtps bread/s bwrtn/s bdscd/s
05:02:23 PM 0.63 0.03 0.60 0.00 0.94 23.99 0.00
Average: 0.63 0.03 0.60 0.00 0.94 23.99 0.00
05:00:50 PM kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty kbanonpg kbslab kbkstack kbpgtbl kbvmused
05:02:23 PM 464156 1565060 1819680 48.64 5268 1303648 6329352 99.48 2054184 836096 408 1569620 148152 12844 27500 36020
Average: 464156 1565060 1819680 48.64 5268 1303648 6329352 99.48 2054184 836096 408 1569620 148152 12844 27500 36020
05:00:50 PM kbswpfree kbswpused %swpused kbswpcad %swpcad
05:02:23 PM 2617828 3608 0.14 44 1.22
Average: 2617828 3608 0.14 44 1.22
05:00:50 PM kbhugfree kbhugused %hugused kbhugrsvd kbhugsurp
05:02:23 PM 0 0 0.00 0 0
Average: 0 0 0.00 0 0
05:00:50 PM dentunusd file-nr inode-nr pty-nr
05:02:23 PM 46806 9568 50737 1
Average: 46806 9568 50737 1
05:00:50 PM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked
05:02:23 PM 5 801 0.27 0.71 0.55 0
Average: 5 801 0.27 0.71 0.55 0
05:00:50 PM DEV tps rkB/s wkB/s dkB/s areq-sz aqu-sz await %util
05:02:23 PM sda 0.63 0.47 12.00 0.00 19.69 0.00 4.49 0.06
05:02:23 PM dm-0 0.76 0.47 12.00 0.00 16.36 0.00 5.41 0.06
05:02:23 PM dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: sda 0.63 0.47 12.00 0.00 19.69 0.00 4.49 0.06
Average: dm-0 0.76 0.47 12.00 0.00 16.36 0.00 5.41 0.06
Average: dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:00:50 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
05:02:23 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:02:23 PM enp0s3 25.73 0.64 2.21 0.05 0.00 0.00 11.76 0.00
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: enp0s3 25.73 0.64 2.21 0.05 0.00 0.00 11.76 0.00
05:00:50 PM IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
05:02:23 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:02:23 PM enp0s3 0.00 0.00 0.00 0.03 0.00 0.00 0.00 0.00 0.00
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: enp0s3 0.00 0.00 0.00 0.03 0.00 0.00 0.00 0.00 0.00
05:00:50 PM call/s retrans/s read/s write/s access/s getatt/s
05:02:23 PM 0.00 0.00 0.00 0.00 0.00 0.00
Average: 0.00 0.00 0.00 0.00 0.00 0.00
05:00:50 PM scall/s badcall/s packet/s udp/s tcp/s hit/s miss/s sread/s swrite/s saccess/s sgetatt/s
05:02:23 PM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:00:50 PM totsck tcpsck udpsck rawsck ip-frag tcp-tw
05:02:23 PM 882 19 2 0 0 1
Average: 882 19 2 0 0 1
05:00:50 PM CPU total/s dropd/s squeezd/s rx_rps/s flw_lim/s blg_len
05:02:23 PM all 25.73 0.00 0.10 0.00 0.00 0
05:02:23 PM 0 25.73 0.00 0.10 0.00 0.00 0
05:02:23 PM 1 0.00 0.00 0.00 0.00 0.00 0
Average: CPU total/s dropd/s squeezd/s rx_rps/s flw_lim/s blg_len
Average: all 25.73 0.00 0.10 0.00 0.00 0
Average: 0 25.73 0.00 0.10 0.00 0.00 0
Average: 1 0.00 0.00 0.00 0.00 0.00 0
student@localhost:~$ systemctl status sysstat-collect.service
○ sysstat-collect.service - system activity accounting tool
Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.service; static)
Active: inactive (dead) since Tue 2026-09-01 17:02:23 +08; 3min 46s ago
Invocation: 5fe21adedb064804b9b026aff0cf5e86
TriggeredBy: ● sysstat-collect.timer
Docs: man:sa1(8)
Process: 6303 ExecStart=/usr/lib64/sa/sa1 1 1 (code=exited, status=0/SUCCESS)
Main PID: 6303 (code=exited, status=0/SUCCESS)
Mem peak: 1.2M
CPU: 16ms
Sep 01 17:02:23 localhost.localdomain systemd[1]: Starting sysstat-collect.service - system activity accounting tool...
Sep 01 17:02:23 localhost.localdomain systemd[1]: sysstat-collect.service: Deactivated successfully.
Sep 01 17:02:23 localhost.localdomain systemd[1]: Finished sysstat-collect.service - system activity accounting tool.
student@localhost:~$ systemctl cat sysstat-collect.service
# /usr/lib/systemd/system/sysstat-collect.service
# /usr/lib/systemd/system/sysstat-collect.service
# (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl>
#
# sysstat-12.7.6 systemd unit file:
# Collects system activity data
# Activated by sysstat-collect.timer unit
[Unit]
Description=system activity accounting tool
Documentation=man:sa1(8)
After=sysstat.service
[Service]
Type=oneshot
User=root
ExecStart=/usr/lib64/sa/sa1 1 1
student@localhost:~$ systemctl status sysstat-collect.timer
● sysstat-collect.timer - Run system activity accounting tool every 10 minutes
Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; preset: enabled)
Active: active (waiting) since Tue 2026-09-01 16:55:00 +08; 11min ago
Invocation: 774f8e9bfe2d4bbdbba911c44879bd32
Trigger: Tue 2026-09-01 17:10:00 +08; 3min 29s left
Triggers: ● sysstat-collect.service
Sep 01 16:55:00 localhost.localdomain systemd[1]: Started sysstat-collect.timer - Run system activity accounting tool every 10 minutes.
student@localhost:~$ systemctl cat sysstat-collect.timer
# /usr/lib/systemd/system/sysstat-collect.timer
# /usr/lib/systemd/system/sysstat-collect.timer
# (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl>
#
# sysstat-12.7.6 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
student@localhost:~$