「CentOS」sarコマンドを利用するメモ

1.sysstatのインストール
# yum install sysstat
Loaded plugins: fastestmirror, langpacks
base                                                     | 3.6 kB     00:00
extras                                                   | 3.4 kB     00:00
remi-safe                                                | 2.9 kB     00:00
updates                                                  | 3.4 kB     00:00
(1/2): updates/7/x86_64/primary_db                         | 5.6 MB   00:00
(2/2): remi-safe/primary_db                                | 930 kB   00:02
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* remi-safe: mirrors.mediatemple.net
* updates: ftp.iij.ad.jp
Resolving Dependencies
–> Running transaction check
—> Package sysstat.x86_64 0:10.1.5-7.el7 will be updated
—> Package sysstat.x86_64 0:10.1.5-11.el7 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package          Arch            Version                   Repository     Size
================================================================================
Updating:
sysstat          x86_64          10.1.5-11.el7             base          310 k

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 310 k
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
sysstat-10.1.5-11.el7.x86_64.rpm                           | 310 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating   : sysstat-10.1.5-11.el7.x86_64                                 1/2
Cleanup    : sysstat-10.1.5-7.el7.x86_64                                  2/2
Verifying  : sysstat-10.1.5-11.el7.x86_64                                 1/2
Verifying  : sysstat-10.1.5-7.el7.x86_64                                  2/2

Updated:
sysstat.x86_64 0:10.1.5-11.el7

Complete!

2.CPU(全体)使用状況確認
#sar -u 1

3.CPU(Core単位)使用状況確認
#sar -P ALL 1

4.ロードアベレージ状況
#sar -q 1

5.メモリ使用状況
#sar -r 1

6.スワップ使用状況
#sar -S 1

7.ディスク使用状況
#sar -p -d 1 1

8.Network使用状況
#sar -n DEV 1 | grep eth0

Linux

Posted by arkgame