sarコマンドを覚える

参考サイトをそのままでもよい気がするが自分の手を使って覚えることに意味があるということで。

■CPU編

sar -u 

[root@gochamaze ~]# sar -u 1
Linux 2.6.32-279.el6.x86_64 (gochamaze) 2015年07月03日 _x86_64_ (1 CPU)

23時35分57秒 CPU %user %nice %system %iowait %steal %idle
23時35分58秒 all 0.00 0.00 0.00 0.00 0.00 100.00
23時35分59秒 all 0.00 0.00 0.99 0.00 0.00 99.01

 

sar -u -P ALL cpuのコアごと取得したい場合は次のように実行する。

[root@gochamaze ~]# sar -u -P ALL 1

23時37分15秒 CPU %user %nice %system %iowait %steal %idle
23時37分16秒 all 0.00 0.00 0.99 0.00 0.00 99.01
23時37分16秒 0 0.00 0.00 0.99 0.00 0.00 99.01

 

■メモリ編

[root@gochamaze ~]# sar -r 1
Linux 2.6.32-279.el6.x86_64 (gochamaze) 2015年07月03日 _x86_64_ (1 CPU)

23時38分23秒 kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit
23時38分24秒 1621076 302728 15.74 22628 121120 323824 5.35
23時38分25秒 1621076 302728 15.74 22628 121120 323824 5.35
23時38分26秒 1621076 302728 15.74 22628 121120 323824 5.35
23時38分27秒 1621076 302728 15.74 22628 121120 323824 5.35
23時38分28秒 1621076 302728 15.74 22628 121120 323824 5.35

 

■ネットワーク編

[root@gochamaze ~]# sar -n DEV 1
Linux 2.6.32-279.el6.x86_64 (gochamaze) 2015年07月03日 _x86_64_ (1 CPU)

23時40分59秒 IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
23時41分00秒 lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
23時41分00秒 eth0 1.00 0.00 0.06 0.00 0.00 0.00 0.00

 

■ディスク編

[root@gochamaze ~]# sar -b 1
Linux 2.6.32-279.el6.x86_64 (gochamaze) 2015年07月03日 _x86_64_ (1 CPU)

23時41分35秒 tps rtps wtps bread/s bwrtn/s
23時41分36秒 0.00 0.00 0.00 0.00 0.00
23時41分37秒 0.00 0.00 0.00 0.00 0.00
23時41分38秒 0.00 0.00 0.00 0.00 0.00
23時41分39秒 0.00 0.00 0.00 0.00 0.00

 

■キュとロードアベレージ

[root@gochamaze ~]# sar -q 1
Linux 2.6.32-279.el6.x86_64 (gochamaze) 2015年07月03日 _x86_64_ (1 CPU)

23時42分51秒 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
23時42分52秒 0 198 0.00 0.00 0.00
23時42分53秒 0 198 0.00 0.00 0.00
23時42分54秒 0 198 0.00 0.00 0.00
23時42分55秒 0 198 0.00 0.00 0.00
23時42分56秒 0 198 0.00 0.00 0.00

 

スワップ

[root@gochamaze ~]# sar -W 1
Linux 2.6.32-279.el6.x86_64 (gochamaze) 2015年07月03日 _x86_64_ (1 CPU)

23時42分37秒 pswpin/s pswpout/s
23時42分38秒 0.00 0.00
23時42分39秒 0.00 0.00
23時42分40秒 0.00 0.00
23時42分41秒 0.00 0.00
23時42分42秒 0.00 0.00

 

まずはこのあたりをきちんと覚える。

 

 

参考サイト

 

http://naoberry.com/tech/sar/