Generate CPU, Memory Report Using SAR Command . SAR (System Activity Report) is an very important unix monitoring  command used to report performance of various Linux subsystem (CPU , Memory, Network statics .., ) in real time.  Using SAR you can generate report of your system performance statics on regular basis and store it for analysis .

As a system administrator you want to know your system activity, CPU report, device statics, generate memory uses. For Generate CPU, Memory Report Using SAR Command you need to install if first. SAR  install with the package sysstat.

Installation and Configuration of Sysstat

If SAR is not installed in your system, you can install with the following command given below –

For ubuntu, you can use

Now, SAR is install in your system. you can check , it is installed or not with the following command –

After installation,  Verify the package using “sar -V” command

After installation now you can ‘Generate CPU, Memory Report Using SAR Command’

Finally , make sure SAR is working properly. The following gives the statics of CPU 5 times with 2 second interval

All the SAR command will have the following as 1st line in its outpot

Linux 2.6.18-274.el5            – Linux kernel version of the system

localhost.localdomain          – The hostname of the system where data was collected

Save SAR output to a file a file with -o option

Use “sar -f ” <file-name> to display the report

Generate memory uses using -r option

You can generate memory uses statics using “sar -r”

Generate paging statics 

you can generate paging statics using -B option with SAR

Generate block device statics

You can generate block device statics using -d option with SAR

Generate network statics

You an generate network statics report using -n option with SAR

Read SAR log file

SAR log file location is /var/log/sa/

The configuration file of sysstat is located in /etc/sysconfig/sysstat

I hove this tutorial is helpful for you to understand SAR command. Now you can “Generate CPU, Memory Report Using SAR” Command We will discuss about other Linux command in next blog.