dstat 監控工具的使用

軟件介紹
dstat是一個用來替換 vmstat,iostat netstat,nfsstat和ifstat這些命令的工具, 是一個全能系統信息統計工具. 與sysstat相比, dstat擁有一個彩色的界面, 在手動觀察性能情況時, 數據比較顯眼容易觀察;可以即時的刷新數據;
執行 dstat 命令的時候,默認他會 收集-cpu-、-disk-、-net-、-paging-、-system-的數據,一秒鐘收集一次。默認輸入 dstat 等於輸入了dstat -cdngy 1或dstat -a 1;
軟件安裝
rhel6  centos6等系統鏡像自帶有這個軟件包
[root@station ~]# yum list |grep dstat
dstat.noarch                    0.7.0-1.el6        @Red Hat Enterprise Linux/6.1
[root@station ~]# yum install dstat -y
軟件使用
# dstat
 安裝完成後, 執行 dstat 命令, 默認狀況它會收集-cpu-,-disk-,-net-,-paging-,-system-的數據, 一秒鐘收集一次. 默認輸入dstat等於輸入了dstat -cdngy 1或dstat -a 1. 推薦使用 date && dstat -tclmdny 60 一分鐘監視一次(注意調節顯示的寬度, 或去掉-t選項).
dstat 選項
-c, -cpu 顯示CPU狀況
-C 0,3,total include cpu0, cpu3 and total
-d, -disk 顯示磁盤狀況
-D total,hda include hda and total
-g, -page enable page stats
-i, -int enable interrupt stats
-I 5,eth2 include int5 and interrupt used by eth2
-l, -load enable load stats
-m, -mem 顯示內存狀況
-n, -net 顯示網絡狀況
-N eth1,total 能夠指定網絡接口
-p, -proc enable process stats
-s, -swap 顯示swap狀況
-S swap1,total 能夠指定多個swap
-t, -time enable time counter
-y, -sys enable system stats
-ipc 報告IPC消息隊列和信號量的使用狀況
-lock enable lock stats
-raw enable raw stats
-tcp enable tcp stats
-udp enable udp stats
-unix enable unix stats
-M stat1,stat2 enable external stats
-mods stat1,stat2
-a, -all 使用-cdngy 缺省的就是這樣顯示
-f, -full 使用 -C, -D, -I, -N and -S 顯示
-v, -vmstat 使用-pmgdsc -D 顯示
-integer show integer values
-nocolor disable colors (implies -noupdate)
-noheaders 只顯示一次表頭之後就不顯示了,使用重定向寫入文件時頗有用
-noupdate disable intermediate updates
-output file 寫入到CVS文件中
這個軟件和vmstat很像, 不過和vmstat相比好像少了io部份的顯示, dstat只能顯示磁盤的吞吐量而不是顯示負載狀況, dstat和幾乎全部監控軟件同樣, 只能對整個系統進行監控而不能對某一個進程或某一個程序進行深刻分析. 使用的參數是dstat -cdlmnpsy, 
作個別名alias dstat='dstat -cdlmnp
相關文章
相關標籤/搜索