科技常识:Linux的系统监控工具dstat常见用法总结

2021-06-06 09:38:59
导读今天小编跟大家讲解下有关科技常识:Linux的系统监控工具dstat常见用法总结,相信小伙伴们对这个话题应该也很关注吧,小编也收集到了有关科

今天小编跟大家讲解下有关科技常识: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,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文件中这个软件和vmstat很像, 不过和vmstat相比好像少了io部份的显示, dstat只能显示磁盘的吞吐量而不是显示负载情况, dstat和几乎所有监控软件一样, 只能对整个系统进行监控而不能对某一个进程或某一个程序进行深入分析. 我常使用的参数是dstat -cdlmnpsy, 做个别名链接alias dstat='dstat -cdlmnpsy'

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

复制代码代码如下:$dstat

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

-c cpu

复制代码代码如下:$ dstat -c

-d 磁盘

复制代码代码如下:$ dstat -d

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

复制代码代码如下:$ dstat -cdl -D sda1

来源:爱蒂网

免责声明:本文由用户上传,如有侵权请联系删除!

猜你喜欢

最新文章