System Activity Report (SAR) is a Unix System monitor command used to report on various system loads. So it including CPU activity, memory/paging, interrupts, device load, network and swap space utilization. Sar uses /procfilesystem to collect information. However, It is very easy to install and it is available package on many distributions.
In this article we will install SAR and run different examples of SAR Commands.
yum install -y sysstat
sudo apt-get install sysstat
Start SAR service, enable it on boot.
systemctl start sysstat.service systemctl enable sysstat.service systemctl status sysstat.service
SAR reports are stores in /var/log/sa directory. A script “sa1” logs SAR output into sysstat binary log file format, and translate it into human readable format in “sar1” file.
Each sar report saved with current date.
e.g if today is 17th the sar report will save as sa17 in binary file and sar17 in human readable file.
To list sar files, you can use following command
Run below command to see system statistics
There are many commands of sar, however some are given below which may helpful for you.
Server’s average load history
You can use following command to check average load on the server.
ALL CPU utilization statistics
Now, use below command to see how much total CPU is consumed.
Memory utilization statistics
So, If you want to check memory utilization stats, use following command.
I/O and transfer rate statistics
Mount Filesystems statistics
Then, If you want to see mounted filesystems execute below command.
Swap space utilization statistics
But what if you wanna see how much SWAP space is using? then issue below command
Kernel table statistics
TTY device statistics
Now you can add sar in your system administration tool to manage and monitor server activities.