System Monitoring, Logging, and Performance Troubleshooting
This domain tests reading the right tool for the symptom, understanding journald and rsyslog, and knowing which metrics identify CPU, memory, disk, or I/O bottlenecks.
Live and historical metrics
- CPU and load:
uptime,top,mpstat -P ALL 1,pidstat 1. Linux load average counts runnable plus uninterruptible (D-state) tasks, so it can be high with idle CPUs. - Memory:
free -m,vmstat 1(watchsi/sofor swapping,wafor I/O wait). - Disk and I/O:
df -h,du -sh /var/*,iostat -xz 1(%util,await,r_await),iotop. - History:
sar -u 1 5,sar -d, stored in/var/log/sa/by the sysstat service.
Logging
- journald:
journalctl -u sshd -b,journalctl -p err --since today,journalctl -f,journalctl --disk-usage,journalctl --vacuum-size=500M. - Persistent journals require
Storage=persistentin/etc/systemd/journald.confand the/var/log/journaldirectory. - rsyslog writes
/var/log/messagesand/var/log/secure; rules live in/etc/rsyslog.confand/etc/rsyslog.d/.loggergenerates test messages. - Rotation is configured in
/etc/logrotate.d/; test withlogrotate -d /etc/logrotate.conf.
Tuning
tuned-adm list,tuned-adm active,tuned-adm profile throughput-performance;nice/renicefor priority,ulimit -afor limits,/etc/sysctl.d/for kernel parameters applied withsysctl --system.
Worked example
df -h reports /var at 100% but du -sh /var/* totals far less. Run lsof +L1 to list deleted-but-still-open files. Reasoning: space held by a deleted file whose file descriptor is open is not counted by du; restarting (or truncating safely via the process) the holding service releases it.
Traps
- Reading high load average as CPU saturation without checking
vmstatwaandiostat. - Journals lost at reboot because storage was left volatile.
sarproduces no history when the sysstat timer/service is not enabled.ducannot see deleted open files;dfcan.