dstat监控工具介绍

一、命令介绍

dstat是监控本机多种资源的监控工具,是vmstat, iostat and ifstat的替代工具。

RHEL6.4安装dstat: rpm -ivh dstat-0.7.0-1.el6.noarch


二、基本使用

直接输入dstat,会使用默认值,每秒显示一次cpu、disk、net、paging、system的数据。等于dstat -cdngy 1。

145810929.jpg


推荐使用 date && dstat -tclmdny 60 一分钟监视一次(注意调节显示的宽度,或去掉-t选项)。

155412303.jpg


基本用法

dstat [-afv] [options..] [delay [count]]

常用选项如下:

dstat 3 #3秒输出一条信息

dstat -N eth0 #显示eth0网卡进出流量

dstat -l #显示cpu在1、5、15分钟的负载

dstat -r #显示io读写流量


有关Dstat涉及的些参数含义说明:

Dstat options:

-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文件中


三、高级用法

显示mem、io、cpu使用最高的进程:

150429662.jpg

如下选项,可以得到占用资源最多的进程和用户。

--top-bio

show most expensive block I/O process

--top-cpu

show most expensive CPU process

--top-cputime

show process using the most CPU time (in ms)

--top-cputime-avg

show process with the highest average timeslice (in ms)

--top-io

show most expensive I/O process

--top-latency

show process with highest total latency (in ms)

--top-latency-avg

show process with the highest average latency (in ms)

--top-mem

show process using the most memory




你可能感兴趣的:(监控,监控工具,dstat)