温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Linux系统中dstat工具的常见用法总结

发布时间:2021-09-15 16:44:34 来源:亿速云 阅读:122 作者:chen 栏目:系统运维

这篇文章主要讲解了“Linux系统中dstat工具的常见用法总结”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Linux系统中dstat工具的常见用法总结”吧!

1) 工具说明
dstat是一个用来替换 vmstat,iostat netstat,nfsstat和ifstat这些命令的工具, 是一个全能系统信息统计工具. 与sysstat相比, dstat拥有一个彩色的界面, 在手动观察性能状况时, 数据比较显眼容易观察; 而且dstat支持即时刷新, 譬如输入dstat 3, 即每三秒收集一次, 但最新的数据都会每秒刷新显示. 和sysstat相同的是, dstat也可以收集指定的性能资源。

2) 软件安装

代码如下:


# cd /tmp
# rz
# rpm -Uvh dstat-0.6.7-1.el*.rf.noarch.rpm
# which dstat
/usr/bin/dstat


或者Ubuntu(Debian系)下:

代码如下:


$ apt-get install dstat


3) dstat 选项

-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,eth3 include int5 and interrupt used by eth3
-l, -load enable load stats
-m, -mem 显示内存情况
-n, -net 显示网络情况
-N eth2,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文件中
这个软件和vmstat很像, 不过和vmstat相比好像少了io部份的显示, dstat只能显示磁盘的吞吐量而不是显示负载情况, dstat和几乎所有监控软件一样, 只能对整个系统进行监控而不能对某一个进程或某一个程序进行深入分析. 我常使用的参数是dstat -cdlmnpsy, 做个别名链接alias dstat='dstat -cdlmnpsy'

4)常见用法
查看有关 cpu,硬盘和网络的详细信息。

代码如下:


$dstat

Linux系统中dstat工具的常见用法总结

查看有关 cpu,硬盘和网络的详细信息。

-c cpu

代码如下:


$ dstat -c

Linux系统中dstat工具的常见用法总结

-d 磁盘

代码如下:


$ dstat -d

Linux系统中dstat工具的常见用法总结

显示 cpu、磁盘等的详细信息。

代码如下:


$ dstat -cdl -D sda1

Linux系统中dstat工具的常见用法总结

感谢各位的阅读,以上就是“Linux系统中dstat工具的常见用法总结”的内容了,经过本文的学习后,相信大家对Linux系统中dstat工具的常见用法总结这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI