Linux下比較全面的監控工具dstat

來源:互聯網
上載者:User
1) 工具說明

dstat是一個用來替換 vmstat,iostat netstat,nfsstat和ifstat這些命令的工具, 是一個全能系統資訊統計工具. 與sysstat相比, dstat擁有一個彩色的介面, 在手動觀察效能狀況時, 資料比較顯眼容易觀察; 而且dstat支援即時重新整理, 譬如輸入dstat 3, 即每三秒收集一次, 但最新的資料都會每秒重新整理顯示. 和sysstat相同的是, dstat也可以收集指定的效能資源, 譬如 dstat -c 即顯示CPU的使用方式.
 下載安裝檔案dstat-0.6.7-1.el*.rf.noarch.rpm: http://dag.wieers.com/rpm/packages/dstat/
2) 軟體安裝

# cd /tmp
# rz (上傳安裝包)
# rpm -Uvh dstat-0.6.7-1.el*.rf.noarch.rpm
# which dstat
 /usr/bin/dstat
3) 使用樣本

# dstat
 安裝完成後, 執行 dstat 命令, 預設情況它會收集-cpu-,-disk-,-net-,-paging-,-system-的資料, 一秒鐘收集一次. 預設輸入dstat等於輸入了dstat -cdngy 1或dstat -a 1. 推薦使用 date && dstat -tclmdny 60 一分鐘監視一次(注意調節顯示的寬度, 或去掉-t選項).
4) 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 -cdlmnpsy'

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.