dstat的安装

目前最新版下载地址:http://dag.wieers.com/home-made/dstat/dstat-0.7.2.tar.bz2

下载完成后解压安装:

# wget http://dag.wieers.com/home-made/dstat/dstat-0.7.2.tar.bz2

# tar jxf dstat-0.7.2.tar.bz2

# cd dstat-0.7.2

# make && make install

安装好dstat后,在命令行直接输入dstat就可以收集信息了,默认使用了选项-cdngy

语法:

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

选项:

   -c, --cpu

       显示cpu信息(system, user, idle, wait, hardware interrupt, software interrupt)

   -C 0,3,total

       当使用了-c/--cpu选项时,此选项才会生效,此选项可以显示指定的逻辑cpu的信息,0,3表示收集cpu0,cpu3的信息,total则显示整个物理cpu的信息

   -d, --disk

       显示磁盘信息(read,write)

   -D hda,total

       当使用了-c/--disk选项时,此选项才会生效,如果指定的磁盘不存在,则默认会使用total来显示所有磁盘的信息,如:磁盘是sda,但在使用dstat时指定的是dstat -d -D hda,这时dstat会显示所有磁盘的信息

   -g, --page

       enable page stats (page in, page out)

   -i, --int

       显示系统中断信息

   -I 5,10

       include interrupt 5 and 10 (when using -i/--int)

   -l, --load

       显示系统负载信息(1 min, 5 mins, 15mins)

   -m, --mem

       显示内存使用信息(used, buffers, cache, free)

   -n, --net

       显示网络信息(receive, send)

   -N eth0,eth1

       当使用了-n选项才可以使用此选项,显示指定网卡的网络信息

   -p, --proc

       显示进程信息(runnable, uninterruptible, new)

   -r, --io

       显示io请求信息(read, write requests)

   -s, --swap

       显示swap分区的使用信息(used, free)

   -S swap1,total

       当使用了-s选项时,这个选项才生效,显示多个swap的信息

   -t, --time

       显示时间

   -T, --epoch

       指定多少秒更新显示的信息  

   -y, --sys

       显示系统的中断和系统上下文交换

   --aio

       显示异步I/0信息(asynchronous I/O)

   --fs

       显示文件系统打开的文件及inodes信息(open files, inodes)

   --ipc

       报告IPC消息队列和信号量的使用情况

   --lock

       enable file lock stats (posix, flock, read, write)

   --raw

       enable raw stats (raw sockets)

   --socket

       enable socket stats (total, tcp, udp, raw, ip-fragments)

   --tcp

       enable tcp stats (listen, established, syn, time_wait, close)

   --udp

       enable udp stats (listen, active)

   --plugin-name

       使用额外插件

   --list

       显示内部和外部的插件名称

更多详细使用帮助信息请man dstat