linux dstat 监控mysql_dstat 好用的Linux监控工具

yum install -y dstat

dstat -tclmdny 60

dstat -tcdnmylp  200

指令–参数—时间(秒)

Dstat的使用:

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

默认输入dstat等于输入了dstat -cdngy 1或dstat -a 1

推荐使用date && dstat -tclmdny 60,一分钟监视一次(注意调节显示的宽度,或去掉-t选项)。

Dstat拥有一个彩色的界面,在手动观察性能状况时,数据比较显眼容易观察。

而且Dstat支持即时刷新,譬如:输入dstat 3,即每三秒收集一次,但最新的数据都会每秒刷新显示。

Dstat也可以收集指定的性能资源。譬如dstat -c,即显示CPU的使用情况。

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 -tclmdny 1 1

每隔1秒显示1次,连续使用1次,这样可以用来写脚本用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值