Tsar 监控命令

命令行使用

tsar命令行主要担负显示历史数据和实时数据的功能,因此有控制展示模块和格式化输出的参数,默认不带任何参数/选项的情况下,tsar打印汇总信息。

tsar命令行主要显示给人看的,所以数据展示中都进行了k/m/g等的进位。

tsar命令会在显示20行数据后再次打印各个列的列头,以利于用户理解数据的含义。

tsar的列头信息包括2行,第一行为模块名,第二行为列名。

tsar输出最后会作min/avg/max的汇总统计,统计所展示中的最小/平均/最大数据。

常用参数:

--help/-h 显示提示信息和模块信息

[like@mmdev5]tsar -h
Usage: tsar [options]
Options:
--cron/-c run in cron mode, output data to file
--interval/-i specify intervals numbers, in minutes if with --live, it is in seconds
--list/-L list enabled modules
--live/-l running print live mode, which module will print
--ndays/-n show the value for the past days (default: 1)
--merge/-m merge multiply item to one
--help/-h help
Modules Enabled:
--swap swap usage
--partition Disk and partition usage
--cpu CPU share (user, system, interrupt, nice, & idle)
--mem Physical memory share (active, inactive, cached, free, wired)
--traffic Net traffic statistics
--load System Run Queue and load average
--tcp TCP traffic (v4)
--udp UDP traffic (v4)
--tcpx TCP connection data
--pcsw Process (task) creation and context switch

--live/-l 启用实时模式,类似iostat等,可以配合-i参数和模块参数使用。

--interval/-i 控制时间间隔,在打印历史数据中,单位是分钟,默认显示间隔5分钟;而实时模式(-l)下,单位是秒,默认是5秒。

--ndays/-n 控制显示多长时间的历史数据,默认1,单位天

--merge/-m 对有多个数据的展示,进行汇总,如机器上跑了3个squid,可以用 tsar --squid -m的放式进行展示汇总。

--cron 用于cron运行tsar采集功能。

常见用法列表:

tsar -i 1 -l 以1秒钟为间隔,实时打印tsar的概述数据

[like@mmdev5 conf]$ tsar -i 1 -l
Time        ---cpu-- ---mem-- ---tcp-- -----traffic---- --sda---  ---load- 
Time          util     util   retran    pktin  pktout     util     load1   
13/05-18:44    0.5     18.4      0.0     75.0   525.0      3.3      0.1   
13/05-18:44    0.4     18.4      0.0     93.0   544.0      0.0      0.1   
13/05-18:44    2.0     18.4      0.0     86.0   532.0     13.0      0.1   
13/05-18:44    0.4     18.4      0.0    141.0    1.0K      0.0      0.1   
13/05-18:44    0.6     18.4      0.0     65.0   510.0      4.9      0.1   
13/05-18:44    0.4     18.4      0.0     52.0   502.0      0.0      0.1   
13/05-18:44    0.4     18.4      0.0     44.0   502.0      0.0      0.1   
13/05-18:44    1.7     18.4      0.0     84.0   527.0     12.4      0.1   
13/05-18:44    0.6     18.4      0.0     62.0   518.0      1.2      0.1   
13/05-18:44    1.2     18.4      0.0     57.0   506.0     26.3      0.1   
13/05-18:44    0.1     18.4      0.0     72.0   513.0     14.4      0.1

tsar 显示1天内的历史汇总(summury)信息,以默认5分钟为间隔

tsar --cpu -i 1 显示一天内cpu的历史信息,以1分钟为间隔

tsar --live --mem -i 2 以2秒钟为间隔,实时打印mem的数据。

tsar --cpu --mem -i 1 显示一天内的cpu和内存历史数据,以1分钟为间隔。

git地址  https://github.com/alibaba/tsar

转载于:https://my.oschina.net/liuhuan0927/blog/672844

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值