歡迎您光臨本站 註冊首頁

監控linux系統資源

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

Dstat是什麼?
可以說,Dstat是 vmstat,iostat,netstat,ifstat的結合體,dstat包含了他們所有沒有的功能,並增加了一些額外的功能,Dstat是用於監測性能優化測試,故障診斷系統功能更方便.
你可以使用Dstat可以查看實時系統的所有資源,將你的磁碟利用率同你的智能磁碟設備控制器的中斷情況進行比對,或比較與磁碟吞吐量的網路帶寬,都是數字比較直觀.

Dstat 監測結果帶顏色,看著更直觀,方便.
官方網站:http://packages.sw.be/dstat/

都是 rpm版本,我的是伺服器是ubuntu,所以我下載源碼編譯的

nginx $> wget wget http://packages.sw.be/dstat/dstat-0.7.2-1.rfx.src.rpm   nginx $> rpm -i dstat-0.7.2-1.rfx.src.rpm   #可能會報錯,不需要管.   nginx $> cd rpmbuild/SOURCES/dstat-0.7.2   nginx $> make install   nginx $> dstat --help
   Usage: dstat [-afv] [options..] [delay [count]]   Versatile tool for generating system resource statistics      Dstat options:     -c, --cpu              enable cpu stats        -C 0,3,total           include cpu0, cpu3 and total     -d, --disk             enable disk stats        -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              enable memory stats     -n, --net              enable network stats        -N eth1,total          include eth1 and total     -p, --proc             enable process stats     -r, --io               enable io stats (I/O requests completed)     -s, --swap             enable swap stats        -S swap1,total         include swap1 and total     -t, --time             enable time/date output     -T, --epoch            enable time counter (seconds since epoch)     -y, --sys              enable system stats        --aio                  enable aio stats     --fs, --filesystem     enable fs stats     --ipc                  enable ipc stats     --lock                 enable lock stats     --raw                  enable raw stats     --socket               enable socket stats     --tcp                  enable tcp stats     --udp                  enable udp stats     --unix                 enable unix stats     --vm                   enable vm stats        --plugin-name          enable plugins by plugin name (see manual)     --list                 list all available plugins        -a, --all              equals -cdngy (default)     -f, --full             automatically expand -C, -D, -I, -N and -S lists     -v, --vmstat           equals -pmgdsc -D total        --float                force float values on screen     --integer              force integer values on screen        --bw, --blackonwhite   change colors for white background terminal     --nocolor              disable colors (implies --noupdate)     --noheaders            disable repetitive headers     --noupdate             disable intermediate updates     --output file          write CSV output to file      delay is the delay in seconds between each update (default: 1)   count is the number of updates to display before exiting (default: unlimited)        

   nginx $> dstat
   You did not select any stats, using -cdngy by default.   ----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--   usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw     0   2  97   1   0   0|  57k  167k|   0     0 |   0     0 |  40    74     0   0 100   0   0   0|   0     0 | 152B  826B|   0     0 |   8    10     0   0 100   0   0   0|   0     0 | 152B  346B|   0     0 |   9    13     0   0 100   0   0   0|   0     0 | 152B  346B|   0     0 |   8     8     0   0 100   0   0   0|   0     0 | 244B  346B|   0     0 |   9     8     0   1  99   0   0   0|   0     0 | 152B  346B|   0     0 |   8     8     0   0 100   0   0   0|   0     0 | 120B  346B|   0     0 |   8     8     0   1  99   0   0   0|   0     0 |  60B  346B|   0     0 |   9    12     0   0 100   0   0   0|   0     0 |  60B  346B|   0     0 |   7     8     0   1  99   0   0   0|   0     0 |  60B  346B|   0     0 |   8     8     0   0 100   0   0   0|   0     0 |  60B  346B|   0     0 |   6     8     0   0 100   0   0   0|   0     0 |  60B  346B|   0     0 |   7     8     0   0 100   0   0   0|   0     0 |  60B  346B|   0     0 |   8    13     0   0 100   0   0   0|   0     0 |  60B  346B|   0     0 |   6     9

常用參數:

   nginx $> dstat -c --top-cpu -d --top-bio --top-latency

nginx $> dstat -cdlmnpsy

本文出自 「linuxer」 博客,請務必保留此出處http://deidara.blog.51cto.com/400447/438289


[火星人 ] 監控linux系統資源已經有714次圍觀

http://coctec.com/docs/linux/show-post-49773.html