|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
1) 工具说明
( \/ ~0 O' G3 Z1 p& x
3 o& Z* i4 ]9 E- R! j/ p' S5 Xdstat是一个用来替换 vmstat,iostat netstat,nfsstat和ifstat这些命令的工具, 是一个全能系统信息统计工具. 与sysstat相比, dstat拥有一个彩色的界面, 在手动观察性能状况时, 数据比较显眼容易观察; 而且dstat支持即时刷新, 譬如输入dstat 3, 即每三秒收集一次, 但最新的数据都会每秒刷新显示. 和sysstat相同的是, dstat也可以收集指定的性能资源, 譬如 dstat -c 即显示CPU的使用情况.7 R) H) p0 o* {
下载安装文件dstat-0.6.7-1.el*.RF.noarch.rpm: http://dag.wieers.com/rpm/packages/dstat/* ~- C6 q4 I. x0 \4 D) y6 K
% r5 F. R2 h C
2) 软件安装
- f) z |1 ]/ i0 t' `' r/ I I" y: C+ T- f0 M: V* o- y @% i4 `% Y+ @
# cd /tmp6 s7 I1 R! ?& N) E
# rz (上传安装包)2 b5 |8 z3 D- L' \. ^
# rpm -Uvh dstat-0.6.7-1.el*.rf.noarch.rpm
/ ?, ~% v. a- \9 T# e! [4 A# which dstat% v/ [8 O% W( O3 C, T
/usr/bin/dstat! t% c m$ r; Q& V$ U
- G A( X1 R9 ?8 [2 R
3) 使用示例
1 {4 f$ ?" z' w3 A4 Q5 A% R8 G8 E( B6 W, s7 K' x8 O8 |
# dstat
* ^2 L; ~# x9 ~安装完成后, 执行 dstat 命令, 默认情况它会收集-cpu-,-disk-,-net-,-paging-,-system-的数据, 一秒钟收集一次. 默认输入dstat等于输入了dstat -cdngy 1或dstat -a 1. 推荐使用 date && dstat -tclmdny 60 一分钟监视一次(注意调节显示的宽度, 或去掉-t选项).
+ J. O3 Z$ a; l, n r6 P# p) _& J1 h; ^9 T% {
4) dstat 选项/ r9 s6 n5 ^ v' @
# T z( B& H& ^% }-c, -cpu 显示CPU情况
8 M) d2 j; K1 g- `5 a8 a+ ]-C 0,3,total include cpu0, cpu3 and total% {/ d* d2 N3 n6 o9 |/ x! t& D
-d, -disk 显示磁盘情况3 y% |7 _( Y3 \$ V6 y, ?
-D total,hda include hda and total3 y: }9 V# x3 F
-g, -page enable page stats0 {; e6 H5 R/ Z: @* G' s2 h
-i, -int enable interrupt stats5 q0 { f& Z3 ]2 y
-I 5,eth2 include int5 and interrupt used by eth2# K" M2 V0 E: p, {4 E2 w
-l, -load enable load stats+ F8 P' r" e: Q. g) Z# H: f
-m, -mem 显示内存情况
9 P- A/ _. I, K3 O# I4 u7 _: ^0 m$ w, H-n, -net 显示网络情况, X) {$ J) H; r e& Z. A
-N eth1,total 可以指定网络接口
$ E* ?6 v: a9 X$ T+ J6 l-p, -proc enable process stats
; x; R0 p, Y" n* H/ J-s, -swap 显示swap情况3 x: J6 }/ k% T1 e" Q
-S swap1,total 可以指定多个swap; g6 k! k- {" z/ g) r
-t, -time enable time counter
2 o& _" c8 L ^8 x4 D g1 e-y, -sys enable system stats
) _- l+ ]3 z% P; A: y& O-ipc 报告IPC消息队列和信号量的使用情况
7 c1 T% S- f5 A: T- a8 i; L-lock enable lock stats
4 y2 q3 T2 J( ]$ [1 c7 X! g, o7 }( B-raw enable raw stats- @8 ~# Q" G6 W% N- p
-tcp enable tcp stats
4 Z* ~6 z# z9 i1 S) J% N-udp enable udp stats
1 t& k6 K7 r" j2 v-unix enable unix stats
5 H: |% X7 j) S( r \- r-M stat1,stat2 enable external stats ?$ v! O [9 `$ i
-mods stat1,stat2$ O9 h: x" E" Q
-a, -all 使用-cdngy 缺省的就是这样显示2 A7 d/ x9 O; c) v
-f, -full 使用 -C, -D, -I, -N and -S 显示% J5 U/ x; I2 h, d" X" R7 k H# g
-v, -vmstat 使用-pmgdsc -D 显示& ?/ p6 L, a6 G
-integer show integer values' z. o2 x' _9 i
-nocolor disable colors (implies -noupdate)" a3 ~( k- y9 d' {4 t$ Y, ?0 q
-noheaders 只显示一次表头以后就不显示了,使用重定向写入文件时很有用
( G6 Y- ?6 e7 C-noupdate disable intermediate updates/ z' {2 v+ g! Z/ X) g% m* j* }
-output file 写入到CVS文件中
9 x+ X( i1 v1 Z" s* a1 F9 O这个软件和vmstat很像, 不过和vmstat相比好像少了io部份的显示, dstat只能显示磁盘的吞吐量而不是显示负载情况, dstat和几乎所有监控软件一样, 只能对整个系统进行监控而不能对某一个进程或某一个程序进行深入分析. 我常使用的参数是dstat -cdlmnpsy, 做个别名链接alias dstat='dstat -cdlmnpsy'& w: u# H/ ]4 L# Q/ @" ?& ?
|
|