于吉吉的技术博客

建造高性能门户网

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  65 随笔 :: 6 文章 :: 149 评论 :: 0 Trackbacks
在微博看到介绍的一款linux系统信息神器,dstat,收藏一下

dstat可以直接可直接替换vmstat, iostat, netstat ,nfsstat, ifstat等系统工具,监控cpu、disk 、mem、load、interrupt、net、proc、CS....

安装
wget http://rpmforge.sw.be/redhat/7.3/en/i386/rpmforge/RPMS/dstat-0.6.9-1.rh7.rf.noarch.rpm
rpm -ivh dstat-0.6.9-1.rh7.rf.noarch.rpm
or
apt-get install dstat
yum install dstat

安装很简单就完成,先看看help

tech163:/usr/local/download# 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
  -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
  --ipc                  enable ipc stats
  --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              equals -cdngy (default)
  -f
, --full             expand -C, -D, -I, -N and -S discovery lists
  -v
, --vmstat           equals -pmgdsc -D total

  --integer              show integer values
  --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
  count is the number of updates to display before exiting
  The default delay is 
1 and count is unspecified (unlimited)

当执行dstat命令时,默认它会收集cpu,disk,net,paging,system等数据,并且每秒收集一次
看一下我们常用的参数

-c, --cpu              enable cpu stats 显示cpu的情况
-d, --disk             enable disk stats 显示硬盘的情况
-l, --load             enable load stats 显示系统的负载情况
-m, --mem              enable memory stats 显示内存的情况
-n, --net              enable network stats 显示网络的情况
-p, --proc             enable process stats 显示进程的情况
-s, --swap             enable swap stats 显示swap的情况
-y, --sys              enable system stats 显示系统的情况
--output file          write CSV output to file 写到csv文件中

默认情况下dstat是每秒钟就收集数据一次,可以修改一下让它每30秒收集一次

dstat -cdlmnpsy 30

----total-cpu-usage---- -dsk/total- ---load-avg--- ------memory-usage----- -net/total- ---procs--- -swp/total- ---system--
usr sys idl wai hiq siq| read  writ| 1m   5m  15m | used  buff  cach  free| recv  send|run blk new| used  free| int   csw 
  
0   0 100   0   0   0| 121B 4116B|   0    0    0|  79M  156M  176M  101M|   0     0 |  0   0   0| 504k 1024M|  20    19 
  
0   0 100   0   0   0|   0  8875B|   0    0    0|  79M  156M  176M  101M|1256B 1140B|  0   0   0| 504k 1024M|  31    31


posted on 2011-03-24 17:15 陈于喆 阅读(2231) 评论(3)  编辑  收藏

评论

# re: 安装配置整理之 dstat[未登录] 2011-05-19 15:42 lee
路过此处,,,lee  回复  更多评论
  

# re: 安装配置整理之 dstat[未登录] 2011-06-14 09:34 deng
不错呀,最近也在研究这方面的东东,刚好看到,不错  回复  更多评论
  

# re: 安装配置整理之 dstat 2014-06-06 15:52 lv
不使用yum该怎么安装,已经下载了dstat的rpm包
是直接使用rpm -ivh dstat-*.rpm进行安装么?
直接这样安装好像不行的样  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: