LinuxでI/Oの状況を確認するのに便利なコマンド「iostat」
CentOSを最小構成でインストールすると導入されていない。
iostatコマンドとiostatを含むsysstatのインストールメモ
iostatコマンドを含むパッケージを調べる
[root@centos73 ~]# yum provides iostat 読み込んだプラグイン:fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * extras: ftp.tsukuba.wide.ad.jp * updates: ftp.tsukuba.wide.ad.jp sysstat-10.1.5-12.el7.x86_64 : Collection of performance monitoring tools for Linux リポジトリー : base 一致 : ファイル名 : /usr/bin/iostat
sysstatのインストール
[root@centos73 ~]# yum install sysstat 読み込んだプラグイン:fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * extras: ftp.tsukuba.wide.ad.jp * updates: ftp.tsukuba.wide.ad.jp 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ sysstat.x86_64 0:10.1.5-12.el7 を インストール --> 依存性の処理をしています: libsensors.so.4()(64bit) のパッケージ: sysstat-10.1.5-12.el7.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ lm_sensors-libs.x86_64 0:3.4.0-4.20160601gitf9185e5.el7 を インストール --> 依存性解決を終了しました。 依存性を解決しました ======================================================================================================================== Package アーキテクチャー バージョン リポジトリー 容量 ======================================================================================================================== インストール中: sysstat x86_64 10.1.5-12.el7 base 310 k 依存性関連でのインストールをします: lm_sensors-libs x86_64 3.4.0-4.20160601gitf9185e5.el7 base 41 k トランザクションの要約 ======================================================================================================================== インストール 1 パッケージ (+1 個の依存関係のパッケージ) 総ダウンロード容量: 351 k インストール容量: 1.2 M Is this ok [y/d/N]: y Downloading packages: (1/2): lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm | 41 kB 00:00:00 (2/2): sysstat-10.1.5-12.el7.x86_64.rpm | 310 kB 00:00:00 ------------------------------------------------------------------------------------------------------------------------ 合計 1.0 MB/s | 351 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64 1/2 インストール中 : sysstat-10.1.5-12.el7.x86_64 2/2 検証中 : sysstat-10.1.5-12.el7.x86_64 1/2 検証中 : lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64 2/2 インストール: sysstat.x86_64 0:10.1.5-12.el7 依存性関連をインストールしました: lm_sensors-libs.x86_64 0:3.4.0-4.20160601gitf9185e5.el7 完了しました! [root@centos73 ~]#
sysstatに含まれるファイル
[root@centos73 ~]# repoquery sysstat sysstat-0:10.1.5-12.el7.x86_64 [root@centos73 ~]# 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@centos73 ~]#
sysstatパッケージに含まれるコマンド
[root@centos73 ~]# 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
sysstatパッケージに含まれるコマンド概要
cifsiostat
[root@centos73 ~]# man cifsiostat | grep -A 1 -E "NAME|SYNOPSIS|DESCRIPTION" NAME cifsiostat - Report CIFS statistics. -- SYNOPSIS cifsiostat [ -h ] [ -k | -m ] [ -t ] [ -V ] [ interval [ count ] ] -- DESCRIPTION The cifsiostat command displays statistics about read and write operations on CIFS filesystems. [root@centos73 ~]#
iostat
[root@centos73 ~]# man iostat | grep -A 1 -E "NAME|SYNOPSIS|DESCRIPTION" NAME iostat - Report Central Processing Unit (CPU) statistics and input/output statistics for devices and parti‐ -- SYNOPSIS iostat [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] [ -j { ID | LABEL | PATH | -- DESCRIPTION The iostat command is used for monitoring system input/output device loading by observing the time the devices [root@centos73 ~]#
mpstat
[root@centos73 ~]# man mpstat | grep -A 1 -E "NAME|SYNOPSIS|DESCRIPTION" NAME mpstat - Report processors related statistics. -- SYNOPSIS mpstat [ -A ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] [ -P { cpu [,...] | ON | ALL } ] [ interval [ -- DESCRIPTION The mpstat command writes to standard output activities for each available processor, processor 0 being the [root@centos73 ~]#
nfsiostat-sysstat
[root@centos73 ~]# man nfsiostat-sysstat | grep -A 1 -E "NAME|SYNOPSIS|DESCRIPTION" NAME nfsiostat-sysstat (the nfsiostat command from the sysstat package) - Report input/output statistics for net‐ -- SYNOPSIS nfsiostat-sysstat [ -h ] [ -k | -m ] [ -t ] [ -V ] [ interval [ count ] ] -- DESCRIPTION The nfsiostat-sysstat command displays statistics about read and write operations on NFS filesystems. [root@centos73 ~]#
pidstat
[root@centos73 ~]# man pidstat | grep -A 1 -E "NAME|SYNOPSIS|DESCRIPTION" NAME pidstat - Report statistics for Linux tasks. -- SYNOPSIS pidstat [ -d ] [ -h ] [ -I ] [ -l ] [ -r ] [ -s ] [ -t ] [ -U [ username ] ] [ -u ] [ -V ] [ -w ] [ -C comm ] -- DESCRIPTION The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel. It [root@centos73 ~]#
sadf
[root@centos73 ~]# man sadf | grep -A 1 -E "NAME|SYNOPSIS|DESCRIPTION" NAME sadf - Display data collected by sar in multiple formats. -- SYNOPSIS sadf [ -C ] [ -d | -j | -p | -x ] [ -H ] [ -h ] [ -T | -t | -U ] [ -V ] [ -P { cpu [,...] | ALL } ] [ -s [ -- DESCRIPTION The sadf command is used for displaying the contents of data files created by the sar(1) command. But unlike [root@centos73 ~]#
sar
[root@centos73 ~]# man sar | grep -A 1 -E "NAME|SYNOPSIS|DESCRIPTION" NAME sar - Collect, report, or save system activity information. -- SYNOPSIS sar [ -A ] [ -B ] [ -b ] [ -C ] [ -d ] [ -H ] [ -h ] [ -p ] [ -q ] [ -R ] [ -r ] [ -S ] [ -t ] [ -u [ ALL ] ] -- DESCRIPTION The sar command writes to standard output the contents of selected cumulative activity counters in the operat‐ [root@centos73 ~]#
tapestat
[root@centos73 ~]# man tapestat | grep -A 1 -E "NAME|SYNOPSIS|DESCRIPTION" NAME tapestat - Report tape statistics. -- SYNOPSIS tapestat [ -k | -m ] [ -t ] [ -V ] [ -y ] [ -z ] [ interval [ count ] ] -- DESCRIPTION The tapestat command is used for monitoring the activity of tape drives connected to a system. [root@centos73 ~]#
試した環境
HW
Product Name ProLiant DL160 Gen8 CPU 4 CPUs x Intel(R) Xeon(R) CPU E5-2603 0 @ 1.80GHz Memory 16GB iLO Firmware Version 2.44 Jul 19 2016
仮想化基盤
OS vmware ESXi 6.0.0 (Build 3620759) 操作環境 VMware Host Client iMac (27-inch, Mid 2010) macOS High Sierra ブラウザ Google Chrome Safari
ゲストOS
[root@centos73 ~]# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) [root@centos73 ~]# uname -a Linux centos73 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux [root@centos73 ~]#