Cyberithub

Practical Steps to Install iostat and mpstat command on Linux(RHEL/CentOS 7/8)

Advertisements

In this article, I will take you through the practical steps required to install iostat and mpstat command on Linux(RHEL/CentOS 7/8). Both iostat and mpstat tools are available through sysstat package in Linux. So to install iostat and mpstat utility you need to install sysstat package with the help of yum command. You can also download sysstat rpm package from CentOS Official website and install it manually but in this way it will ask to install multiple dependent packages along with the rpm file so it will be much easier to install sysstat package through yum utility instead of using rpm package.

Practical Steps to Install iostat and mpstat command on Linux(RHEL/CentOS 7/8)

Steps to Install iostat and mpstat command on Linux(RHEL/CentOS 7/8)

Also Read: 16 Fdisk command examples to Manage Disk Partitions in Linux

Step 1: Prerequisites

a) You need to have a running RHEL/CentOS 7/8 System.

b) You should have yum tool installed in your Server. You can check Top 22 YUM command examples in RedHat/CentOS 7 to know more about yum command.

c) You need to have root or sudo access to run privileged commands. Please Check How to Add User to Sudoers to know more about providing sudo access to the User.

Step 2: Update Your Server

Before going through the steps to install iostat and mpstat command on Linux Server it is always recommended to update your Server first with latest available release by using yum update -y command as shown below. This step is especially more important for those servers which were not updated from quite sometime.

[root@localhost ~]# yum update -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 5.0 kB 00:00:00
* base: centos.hbcse.tifr.res.in
* epel: epel.mirror.angkasa.id
* extras: centos.hbcse.tifr.res.in
* updates: centos.hbcse.tifr.res.in
epel | 4.7 kB 00:00:00
mysql-connectors-community | 2.6 kB 00:00:00
mysql-tools-community | 2.6 kB 00:00:00
mysql56-community | 2.6 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 1.0 MB 00:00:11
(2/2): epel/x86_64/primary_db | 6.9 MB 00:00:16
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-glib.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager-glib.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-libnm.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager-libnm.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-team.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager-team.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-tui.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager-tui.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-wifi.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager-wifi.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package ansible.noarch 0:2.9.14-1.el7 will be updated
---> Package ansible.noarch 0:2.9.15-1.el7 will be an update
---> Package bind-export-libs.x86_64 32:9.11.4-26.P2.el7 will be updated
---> Package bind-export-libs.x86_64 32:9.11.4-26.P2.el7_9.2 will be an update
---> Package bind-libs.x86_64 32:9.11.4-26.P2.el7 will be updated
---> Package bind-libs.x86_64 32:9.11.4-26.P2.el7_9.2 will be an update
---> Package bind-libs-lite.x86_64 32:9.11.4-26.P2.el7 will be updated
---> Package bind-libs-lite.x86_64 32:9.11.4-26.P2.el7_9.2 will be an update
---> Package bind-license.noarch 32:9.11.4-26.P2.el7 will be updated
---> Package bind-license.noarch 32:9.11.4-26.P2.el7_9.2 will be an update
---> Package bind-utils.x86_64 32:9.11.4-26.P2.el7 will be updated
---> Package bind-utils.x86_64 32:9.11.4-26.P2.el7_9.2 will be an update
---> Package centos-release.x86_64 0:7-9.2009.0.el7.centos will be updated
---> Package centos-release.x86_64 0:7-9.2009.1.el7.centos will be an update
---> Package coreutils.x86_64 0:8.22-24.el7 will be updated
---> Package coreutils.x86_64 0:8.22-24.el7_9.2 will be an update
---> Package curl.x86_64 0:7.29.0-59.el7 will be updated
---> Package curl.x86_64 0:7.29.0-59.el7_9.1 will be an update
---> Package device-mapper-multipath.x86_64 0:0.4.9-133.el7 will be updated
---> Package device-mapper-multipath.x86_64 0:0.4.9-134.el7_9 will be an update
---> Package device-mapper-multipath-libs.x86_64 0:0.4.9-133.el7 will be updated

Step 3: Install Sysstat Package

Sysstat package can be installed by using yum install sysstat -y command as shown below. This will install iostat and mpstat tool in your server.

[root@localhost ~]# yum install sysstat -y
Loaded plugins: fastestmirror
* base: centos.hbcse.tifr.res.in
* epel: epel.mirror.angkasa.id
* extras: centos.hbcse.tifr.res.in
* updates: centos.hbcse.tifr.res.in
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package sysstat.x86_64 0:10.1.5-19.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
sysstat x86_64 10.1.5-19.el7 base 315 k

Transaction Summary
========================================================================================================================================================================
Install 1 Package

Total download size: 315 k
Installed size: 1.1 M
Downloading packages:
sysstat-10.1.5-19.el7.x86_64.rpm | 315 kB 00:00:20
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : sysstat-10.1.5-19.el7.x86_64 1/1
Verifying : sysstat-10.1.5-19.el7.x86_64 1/1

Installed:
sysstat.x86_64 0:10.1.5-19.el7

Complete!

Step 4: Verify Package Installation

Once the package is installed you can verify the source package of the command mpstat and iostat by querying the RPM DB using rpm -qf <tool_path> command. Please Check 25 Practical and Useful rpm command examples in Linux{cheatsheet} to know more about rpm command.

[root@localhost ~]# rpm -qf /usr/bin/mpstat
sysstat-10.1.5-19.el7.x86_64
[root@localhost ~]# rpm -qf /usr/bin/iostat
sysstat-10.1.5-19.el7.x86_64

Step 5: Check iostat and mpstat version

If you check the current installed version iostat and mpstat command using -Version option then you will see current installed version is 10.1.5 for both of them.

[root@localhost ~]# iostat -Version
sysstat version 10.1.5
(C) Sebastien Godard (sysstat <at> orange.fr)
[root@localhost ~]# mpstat -Version
sysstat version 10.1.5
(C) Sebastien Godard (sysstat <at> orange.fr)

Step 6: Checking I/O Performance Using iostat

To check Linux Server I/O performance you can simply run iostat command as shown below. Here you can get important information like amount of data read from the device, amount of data written to the device, number of read requests, number of write requests and so on. Check more on iostat Man Page.

[root@localhost ~]# iostat
Linux 3.10.0-1160.2.2.el7.x86_64 (localhost.localdomain) 12/06/2020 _x86_64_ (1 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
0.41 0.01 0.27 0.10 0.00 99.21

Device: tps  kB_read/s kB_wrtn/s kB_read kB_wrtn
sda     7.34 114.72    16.63     373234  54111
sdb     0.04 0.83      0.00      2688      0
sdc     0.05 1.62      0.00      5284      0
dm-0    7.21 104.59    16.00     340287  52043
dm-1    0.03 0.68      0.00      2204      0

Step 7: Checking Processor Stats Using mpstat

To check the Linux Server Processor stats you can simply run mpstat command as shown below. By default it will show information about all the CPUs. Using this tool you can check processor information like cpu utilization at user level, cpu utilization at system level, cpu utilization at user level with nice priority, time spent by cpu to service hardware interrupts and so on. Check more on mpstat Man Page.

[root@localhost ~]# mpstat
Linux 3.10.0-1160.2.2.el7.x86_64 (localhost.localdomain) 12/06/2020 _x86_64_ (1 CPU)

03:34:29 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
03:34:29 AM all 0.41 0.01  0.26  0.10   0.00 0.01  0.00   0.00   0.00   99.21

 

 

 

 

Popular Recommendations:-

8 dumpe2fs command examples to Manage EXT2, EXT3 and EXT4 Filesystem in Linux

How to Suppress all the output of a Linux Bash Shell Script

7 Simple Steps to Install MTR(My Traceroute) on Linux(RHEL/CentOS 7/8)

How to Install Arpwatch tool on RHEL/CentOS 7/8(Simple and Effective Steps)

How to Install and Use i3 Window Manager on Ubuntu 20.04

Troubleshooting Guide to Fix All Postfix mail Server issues in Linux[Practical Solutions]

How to Convert/Change time to epoch time using date utility on Linux/Unix Server

Leave a Comment