社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  linux

dstat安装与使用

Py站长 • 4 年前 • 1083 次点击  

一、什么是dstat?

通过man帮助,可以看到官方对dstat的定义为:多功能系统资源统计生成工具( versatile tool for generating system resource statistics)。在获取的信息上有点类似于top、free、iostat、vmstat等多个工具的合集,官方解释为vmstat、 iostat、ifstat等工具的多功能替代品,且添加了许多额外的功能(Dstat is a versatile replacement for vmstat, iostat and ifstat. Dstat overcomes some of the limitations and adds some extra features.);其结果可以保持到csv文件,使用脚本或第三方工具对性能进行分析利用(如通过监控平台监控,也可以保持到数据库)。在Centos 6.x系统上安装基本服务器即默认安装,而在其他操作系统可能需要手动安装。

二、安装 方法一:yum

1

yum install -y dstat

方法二:rpm

官网下载地址:

http://dag.wieers.com/rpm/packages/dstat

1 2

wget http://dag.wieers.com/rpm/packages/dstat/dstat-0.6.7-1.rh7.rf.noarch.rpm

rpm -ivh dstat-0.6.7-1.rh7.rf.noarch.rpm

三、参数

-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 显示负载

-m, –mem 显示内存情况

-n, –net 显示网络情况

-N eth1,total 可以指定网络接口

-p, –proc 进程

-s, –swap 显示swap情况

-S swap1,total 可以指定多个swap

-t, –time 当前时间

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

dstat -cdlmnpsy

四、使用

dstat,cpu

执行 dstat 命令,默认情况它会收集-cpu-、-disk-、-net-、-paging-、-system-的数据,一秒钟收集一次

dstat,cpu

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/56006
 
1083 次点击