“ 目录RHCA - 12 系统监控 - 9 dstat命令监控系统资源 ”查看CPU、网络、磁盘等监控信息语法格式dstat [参数]参数作用--help查看帮助-c, --cpu只查看CPU统计信息-d, --disk只查看磁盘统计信息-m, --mem只查看内存统计信息-n, --net只查看网络统计信息--tcp只查看TCP状态统计信息--top-cpu查看占用CPU最高的进程--top-mem查看占用内存最高的进程--top-io查看占用IO最高的进程一、安装[rootwuzuniao ~]# yum -y install dstat #安装软件包二、使用[rootwuzuniao ~]# 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 csw0 0 99 0 0 0| 47k 3615B| 0 0 | 0 0 | 37 640 0 100 0 0 0| 0 0 | 180B 886B| 0 0 | 33 421 0 99 0 0 0| 0 0 | 300B 444B| 0 0 | 56 81 ^C[rootwuzuniao ~]# dstat --tcp #查看tcp监控信息----tcp-sockets----lis act syn tim clo10 2 0 0 010 2 0 0 0[rootwuzuniao ~]# dstat --top-mem #查看占用CPU最高的进程--most-expensive-memory processgnome-shell 139Mgnome-shell 139M[rootwuzuniao ~]# dstat --top-cpu #查看占用内存最高的进程-most-expensive-cpu processgnome-shell 0.2kworker/0:1 1.0[rootwuzuniao ~]#三、查看帮助[rootwuzuniao ~]# dstat --help #查看帮助Usage: dstat [-afv] [options..] [delay [count]]Versatile tool for generating system resource statisticsDstat 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--bits force bits for values expressed in bytes--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--profile show profiling statistics when exiting dstatdelay is the delay in seconds between each update (default: 1)count is the number of updates to display before exiting (default: unlimited)[rootwuzuniao ~]#