Categories: Ubuntu

How to use SAR Command in Linux

There are many Linux tools which can be used to analyze and monitor system performance and logs. If you are system/server administrator, then you definitely use such tools to monitor your servers and records its logs. But in this article you will learn about a very useful tool System Activity Report (SAR) which is a Linux/Unix command, used to monitor and report on various system loads. It is used to monitor CPU activity, memory/paging, interrupts, device load, network and swap space utilization. SAR uses /procfilesystem for gathering information.

In this article we will install SAR and use it to monitor server.

Sponsored
class=”wp-block-heading”>Run below command to install SAR on CentOS, RHEL, Fedora
yum install -y sysstat
If you want to install it on Ubuntu run following command
sudo apt-get install sysstat

Start and enable SAR service on system boot.

systemctl start sysstat.service
systemctl enable sysstat.service
systemctl status sysstat.service

SAR reports are saved 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 and every sar report saved with current date. E.g if today is 10th the sar report will save as sa10 in binary file and sar10 in human readable file.

So you can use below command to see all sar files.

ls /var/log/sa

Run below command to see system statistics.

sar

There are many sar commands but some useful commands are given below.

You can check Server’s average load history using below command.

sar -q

So if you want to see Memory statistics use following command.

sar -R

Command to see CPU utilization statistics.

Sponsored
sar -u

List Memory utilization statistics using -r switch with sar command

sar -r

Check I/O and transfer rate statistics.

sar -b

Mounted Filesystems statistics.

sar -F

Check Swap space utilization statistics using following command.

sar -S

Kernel table statistics.

sar -v

Paging statistics.

sar -B

TTY device statistics.

sar -y

That’s it, hope you like this article. You can add sar in your administration tools to manage and monitor your server activities.

The post How to use SAR Command in Linux appeared first on Osgrove.

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

3 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

4 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

5 days ago