[LINUX] Enable sar command on CentOS (install sysstat)

1. Environment

[root@CENTOS7 ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@CENTOS7 ~]#

2. Install yum-utils

Although it is not related to the sar command, install yum-utils to use the repoquery command to check the files included in the package. If you install sysstat without installing yum-utils, you can use the sar command.

yum install -y yum-utils

Execution result


[root@CENTOS7 ~]# yum install -y yum-utils
Loaded plugin:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving dependencies
-->Performing transaction confirmation.
--->Package yum-utils.noarch 0:1.1.31-52.install el7
-->I'm dealing with dependencies: python-kitchen package: yum-utils-1.1.31-52.el7.noarch
-->I'm dealing with dependencies: libxml2-python package: yum-utils-1.1.31-52.el7.noarch
-->Performing transaction confirmation.
--->Package libxml2-python.x86_64 0:2.9.1-6.el7_2.Install 3
--->Package python-kitchen.noarch 0:1.1.1-5.install el7
-->I'm dealing with dependencies: python-chardet package: python-kitchen-1.1.1-5.el7.noarch
-->Performing transaction confirmation.
--->Package python-chardet.noarch 0:2.2.1-3.install el7
-->Dependency resolution finished.

Resolved the dependency

================================================================================
Package architecture
Version repository
capacity
================================================================================
During installation:
 yum-utils             noarch        1.1.31-52.el7            base        121 k
Dependency related installation:
 libxml2-python        x86_64        2.9.1-6.el7_2.3          base        247 k
 python-chardet        noarch        2.2.1-3.el7              base        227 k
 python-kitchen        noarch        1.1.1-5.el7              base        267 k

Transaction summary
================================================================================
Installation 1 package(+Package of 3 dependencies)

Total download capacity: 862 k
Installation capacity: 4.3 M
Downloading packages:
(1/4): python-chardet-2.2.1-3.el7.noarch.rpm               | 227 kB   00:01
(2/4): yum-utils-1.1.31-52.el7.noarch.rpm                  | 121 kB   00:01
(3/4): python-kitchen-1.1.1-5.el7.noarch.rpm               | 267 kB   00:02
(4/4): libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm           | 247 kB   00:02
--------------------------------------------------------------------------------
Total 326 kB/s | 862 kB  00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
During installation: python-chardet-2.2.1-3.el7.noarch               1/4
During installation: python-kitchen-1.1.1-5.el7.noarch               2/4
During installation: libxml2-python-2.9.1-6.el7_2.3.x86_64           3/4
During installation: yum-utils-1.1.31-52.el7.noarch                  4/4
During verification: python-kitchen-1.1.1-5.el7.noarch               1/4
During verification: yum-utils-1.1.31-52.el7.noarch                  2/4
During verification: libxml2-python-2.9.1-6.el7_2.3.x86_64           3/4
During verification: python-chardet-2.2.1-3.el7.noarch               4/4

Installation:
  yum-utils.noarch 0:1.1.31-52.el7

I have installed dependency related:
  libxml2-python.x86_64 0:2.9.1-6.el7_2.3  python-chardet.noarch 0:2.2.1-3.el7
  python-kitchen.noarch 0:1.1.1-5.el7

Has completed!
[root@CENTOS7 ~]#

3. Find the package that provides the sar command

Find the package that provides the sar command with the following command. yum provides sar

Execution result


[root@CENTOS7 ~]# yum provides sar
Loaded plugin:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
sysstat-10.1.5-18.el7.x86_64 : Collection of performance monitoring tools for
                             : Linux
Repository: base
match:
file name: /usr/bin/sar



[root@CENTOS7 ~]#

I found that the sar command exists in sysstat-10.1.5-18.el7.x86_64.

4. Install the sysstat package

Install the sysstat package with the following command.

yum install -y sysstat

Execution result


[root@CENTOS7 ~]# yum install -y sysstat
Loaded plugin:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving dependencies
-->Performing transaction confirmation.
--->Package sysstat.x86_64 0:10.1.5-18.install el7
-->I'm dealing with dependencies: libsensors.so.4()(64bit)Package: sysstat-10.1.5-18.el7.x86_64
-->Performing transaction confirmation.
--->Package lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.Install el7
-->Dependency resolution finished.

Resolved the dependency

================================================================================
Package architecture
Version repository
capacity
================================================================================
During installation:
 sysstat            x86_64    10.1.5-18.el7                       base    315 k
Dependency related installation:
 lm_sensors-libs    x86_64    3.4.0-8.20160601gitf9185e5.el7      base     42 k

Transaction summary
================================================================================
Installation 1 package(+1 dependency package)

Total download capacity: 357 k
Installation capacity: 1.2 M
Downloading packages:
(1/2): sysstat-10.1.5-18.el7.x86_64.rpm                    | 315 kB   00:00
(2/2): lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_ |  42 kB   00:01
--------------------------------------------------------------------------------
Total 254 kB/s | 357 kB  00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
During installation: lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el   1/2
During installation: sysstat-10.1.5-18.el7.x86_64                    2/2
During verification: lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el   1/2
During verification: sysstat-10.1.5-18.el7.x86_64                    2/2

Installation:
  sysstat.x86_64 0:10.1.5-18.el7

I have installed dependency related:
  lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7

Has completed!
[root@CENTOS7 ~]#

5. Check the files included in the sysstat package

Check the files included in the sysstat package with the following command. (You need to install the yum-utils package to use the repoquery command.)

repoquery --list sysstat

Execution result


[root@CENTOS7 ~]# repoquery sysstat
sysstat-0:10.1.5-18.el7.x86_64
[root@CENTOS7 ~]# repoquery --list sysstat
/etc/cron.d/sysstat
/etc/sysconfig/sysstat
/etc/sysconfig/sysstat.ioconf
/usr/bin/cifsiostat
/usr/bin/iostat
/usr/bin/mpstat
/usr/bin/nfsiostat-sysstat
/usr/bin/pidstat
/usr/bin/sadf
/usr/bin/sar
/usr/bin/tapestat
/usr/lib/systemd/system/sysstat.service
/usr/lib64/sa
/usr/lib64/sa/sa1
/usr/lib64/sa/sa2
/usr/lib64/sa/sadc
/usr/share/doc/sysstat-10.1.5
/usr/share/doc/sysstat-10.1.5/CHANGES
/usr/share/doc/sysstat-10.1.5/COPYING
/usr/share/doc/sysstat-10.1.5/CREDITS
/usr/share/doc/sysstat-10.1.5/FAQ
/usr/share/doc/sysstat-10.1.5/README
/usr/share/doc/sysstat-10.1.5/sysstat-10.1.5.lsm
/usr/share/locale/af/LC_MESSAGES/sysstat.mo
/usr/share/locale/cs/LC_MESSAGES/sysstat.mo
/usr/share/locale/da/LC_MESSAGES/sysstat.mo
/usr/share/locale/de/LC_MESSAGES/sysstat.mo
/usr/share/locale/eo/LC_MESSAGES/sysstat.mo
/usr/share/locale/es/LC_MESSAGES/sysstat.mo
/usr/share/locale/eu/LC_MESSAGES/sysstat.mo
/usr/share/locale/fi/LC_MESSAGES/sysstat.mo
/usr/share/locale/fr/LC_MESSAGES/sysstat.mo
/usr/share/locale/hr/LC_MESSAGES/sysstat.mo
/usr/share/locale/id/LC_MESSAGES/sysstat.mo
/usr/share/locale/it/LC_MESSAGES/sysstat.mo
/usr/share/locale/ja/LC_MESSAGES/sysstat.mo
/usr/share/locale/ky/LC_MESSAGES/sysstat.mo
/usr/share/locale/lv/LC_MESSAGES/sysstat.mo
/usr/share/locale/mt/LC_MESSAGES/sysstat.mo
/usr/share/locale/nb/LC_MESSAGES/sysstat.mo
/usr/share/locale/nl/LC_MESSAGES/sysstat.mo
/usr/share/locale/nn/LC_MESSAGES/sysstat.mo
/usr/share/locale/pl/LC_MESSAGES/sysstat.mo
/usr/share/locale/pt/LC_MESSAGES/sysstat.mo
/usr/share/locale/pt_BR/LC_MESSAGES/sysstat.mo
/usr/share/locale/ro/LC_MESSAGES/sysstat.mo
/usr/share/locale/ru/LC_MESSAGES/sysstat.mo
/usr/share/locale/sk/LC_MESSAGES/sysstat.mo
/usr/share/locale/sr/LC_MESSAGES/sysstat.mo
/usr/share/locale/sv/LC_MESSAGES/sysstat.mo
/usr/share/locale/uk/LC_MESSAGES/sysstat.mo
/usr/share/locale/vi/LC_MESSAGES/sysstat.mo
/usr/share/locale/zh_CN/LC_MESSAGES/sysstat.mo
/usr/share/locale/zh_TW/LC_MESSAGES/sysstat.mo
/usr/share/man/man1/cifsiostat.1.gz
/usr/share/man/man1/iostat.1.gz
/usr/share/man/man1/mpstat.1.gz
/usr/share/man/man1/nfsiostat-sysstat.1.gz
/usr/share/man/man1/pidstat.1.gz
/usr/share/man/man1/sadf.1.gz
/usr/share/man/man1/sar.1.gz
/usr/share/man/man1/tapestat.1.gz
/usr/share/man/man5/sysstat.5.gz
/usr/share/man/man8/sa1.8.gz
/usr/share/man/man8/sa2.8.gz
/usr/share/man/man8/sadc.8.gz
/var/log/sa
[root@CENTOS7 ~]#

6. Check only the commands from the files included in the sysstat package

Check only the commands from the files included in the sysstat package with the following command. (You need to install the yum-utils package to use the repoquery command.)

repoquery --list sysstat | grep bin

Execution result


[root@CENTOS7 ~]# repoquery --list sysstat | grep bin
/usr/bin/cifsiostat
/usr/bin/iostat
/usr/bin/mpstat
/usr/bin/nfsiostat-sysstat
/usr/bin/pidstat
/usr/bin/sadf
/usr/bin/sar
/usr/bin/tapestat
[root@CENTOS7 ~]#

You can see that there are commands such as ʻiostat in addition to the sar` command.


that's all

Recommended Posts

Enable sar command on CentOS (install sysstat)
Install Faiss on CentOS 7
Install numba on CentOS 7.2
Install Python3.4 on CentOS 6.6
Install mecab-python on CentOS
Install Python 2.7.3 on CentOS 5.4
Install awscli on centos7
Install Chainer on CentOS 6.7
Install ImageMagick-6.2.x series on CentOS7.7
Install Python 3.8 on CentOS 7 (SCL)
Install Chrome on CentOS 7 series
Install Python 3.8 on CentOS 8 (AppStream)
Steps to install MySQL 8.0 on CentOS 8.1
raspberry pi 4 centos7 install on docker
Steps to install VirtualBox on CentOS
Install java (Oracle JDK14) on CentOS7
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
Install pip on CentOS7. Also iPython.
Install VirtualBox on CentOS 7 on VirtualBox (mac + vagrant)
Install Python on CentOS using Pyenv
How to install Maven on CentOS
Study Note 9_Install Jenkins on CentOS7
Install Python on CentOS using pyenv
Install Mecab on Linux (CentOS) with brew
How to install Apache (httpd) on CentOS7
How to install Eclipse GlassFish 5.1.0 on CentOS 7
How to install Apache (httpd) on CentOS8
Install PostgreSQL from source code on CentOS
Install pyenv and rbenv on CentOS system-wide
[Ansible] Install dnf on Centos7 with Python3 interpreter
CentOS8 --Install --Django
[Failure] Install Stack Overflow Clone Askbot on CentOS 6.4
CentOS8 --Install --Python3
How to install Git GUI and Gitk on CentOS
Install Tensorflow on Mac
Install TensorFlow on Ubuntu
Install python on WSL
Install pyenv on mac
Install pip on Mavericks
Install Python on Pidora.
Install mongodb on termux
Install Scrapy on python3
Install docker on Fedora31
Install Ansible on Mac
Install Python on Mac
CentOS version confirmation command
Install Python 3 on Mac
Install Plone (4.3.6) on MacOSX (10.10.3)
Install PySide2 on Ubuntu
Install gensim on Marvericks
Install JModelica on Ubuntu
Install Anaconda on Windows 10
Install numpy on Marvericks
Install python on windows
Install enebular-agent on Chromebook
Install pycuda on Windows10
Install the pip command
Install aws-cli on MacPorts
Install pygraphviz on Windows 10
Install Docker on AWS