Produce And Deliver Reports On System Utilization Processor Memory Disk And Network
General Information
System utilization reporting.
Lab Setup
The following virtual machines will be used:
- server1.example.com (192.168.1.150) → Configure and test system reporting
Help
Finding help in this section.
- standard man pages
man dstat man sar man sadf
Dstat
Dstat is good for real time monitoring and reporting.
Install
yum install dstat
Running dstat with default options
dstat
- Defaults: -cdngy
- c → cpu
- d → disk
- n → network
- g → page stats
- y → system stats (interrupts, context switches)
Write stats to a file/report
dstat -tcdm --output system-stats.csv
- t → time
- c → cpu
- d → disk
- m → memory
Sysstat
Sysstat runs periodically and provides historical statistics.
See here for more sar commands.
Install
yum install sysstat
Sysstat config file
- /etc/sysconfig/sysstat
- Configure history, compression, and compression program
Cron jobs
- /etc/cron.d/sysstat
- sa1 → System activity every 10 mins by default
- sa2 → Daily summary
System activity log files
- /var/log/sa/
- sa## → Number is the day of the month
View info now from a system activity file
sar -urd -f /var/log/sa/sa01
Semi Colon Separated: Print data from a system activity file, redirect to a file to view later
sadf -d /var/log/sa/sa01 -- -urd -n DEV > system-stats.txt
- -d → Print contents of the data file in an easy to ingest by database format (semi colon separated)
- – → sar options will follow
- -u → sar option: CPU usage
- -r → sar option: Memory usage
- d → sar option: Disk usage (d)
- -n DEV → sar option: Network stats from devices