Linux Stall
  • Home
  • Android
  • How to
  • Perl
  • Tips
  • Tutorials
No Result
View All Result
Linux Stall
No Result
View All Result
Home How to

How to Install And Enable SAR (SYSSTAT) On Linux Servers

Chankey Pathak by Chankey Pathak
July 12, 2020
in How to
46 1
0
sar command output
16
SHARES
777
VIEWS
Share on FacebookShare on Twitter

In this guide I will be showing you how to install and enable the SAR utility/command on Linux servers. The SAR command can be used to look at performance history, and is really useful for identifying when CPU spikes occurred and more. And example of one of the outputs that SAR is capable of delivering is below.

[email protected]:~# sar -p
Linux 4.4.0-93-generic (chankeypathak)   09/07/2017      _x86_64_        (1 CPU)

11:22:27 PM  LINUX RESTART      (1 CPU)

11:24:01 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
11:26:01 PM     all      3.66      0.00      0.79      0.33      0.04     95.18
11:28:01 PM     all      0.72      0.00      0.17      0.07      0.03     99.02
11:30:01 PM     all      2.37      0.00      0.48      0.15      0.06     96.94
11:32:01 PM     all      2.01      0.00      0.48      0.16      0.08     97.26
11:34:01 PM     all      5.65      0.00      1.13      0.33      0.08     92.82
11:36:01 PM     all      2.85      0.00      0.59      0.31      0.07     96.18
11:38:01 PM     all      3.06      0.00      0.62      0.17      0.03     96.12
Average:        all      2.90      0.00      0.61      0.22      0.06     96.22

To install sysstat (contains SAR) and any dependencies you can use one of the following commands depending on your distribution.

RHEL/CentOS/Fedora

For Red Hat, CentOS, and Fedora you will use the following yum command to install sysstat.

sudo yum install sysstat -y

Ubuntu/Debian

For Ubuntu, Debian, and other distributions based on the two, you will use the following apt-get command to install SAR.

sudo apt-get install sysstat -y

Enabling SAR Command

If you are running RHEL and possibly CentOS or Fedora, then you should be set, if you are running a Debian or Ubuntu based OS though then you will still need to enable it. You can do so by running the command below or manually editing the file /etc/default/sysstat.

sudo echo 'ENABLED="true"' /etc/default/sysstat

Next you will need to restart the actual service which can be done with either of the following commands (second command depends on if your system still uses init.d or not).

sudo service sysstat restart
OR
sudo /etc/init.d/sysstat restart

Congratulations, everything is now setup and working. Please note that SAR may not show any results right away, by default it grabs the systems information every 10 minutes.

I hope this quick and easy guide was useful, please don’t forget to comment/share, thanks!

Source: sysstat
Tags: cpuinfohow tomonitoringsarstats
Previous Post

Remove OS Information From Postfix Banner

Next Post

Writing A Basic Expect Script For Automating Tasks

Chankey Pathak

Chankey Pathak

Data Scientist at Morgan Stanley. I've been using Linux since past 12 years. I plan to share what I know about Linux in this blog.

Related Posts

The three-dimensional network topology infographics with ip addresses 3d illustration
How to

Identifying and Resolving IP Address Conflicts with Linux

July 23, 2020
procmon
How to

Microsoft releases ProcMon (Process Monitor) utility for Linux

July 21, 2020
searching file
How to

How to find files by size in Linux

July 12, 2020
Blue padlock icon computer security system vector
How to

How To Enable TLS Encryption On Postfix

July 12, 2020
Blue padlock icon computer security system Encryption
How to

Running Commands Automatically Over SSH

July 12, 2020
postfix-mailserver logo
How to

Remove OS Information From Postfix Banner

July 12, 2020
Next Post
Professional Developer programmer working a software website design and coding technology, writing codes and database in company office, Global cyber connection technology.

Writing A Basic Expect Script For Automating Tasks

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Terms and Conditions
  • Contact Us
  • About Us

© 2012 - 2020 Linux Stall - A place for all your Linux needs.

No Result
View All Result
  • Home
  • Android
  • How to
  • Perl
  • Tips
  • Tutorials

© 2012 - 2020 Linux Stall - A place for all your Linux needs.

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In