Tsar介绍
Tsar (Taobao System Activity Reporter) is a monitoring tool, which can be used to gather and summarize system information, e.g. CPU, load, IO, and application information, e.g. nginx, HAProxy, Squid, etc. The results can be stored at local disk or sent to Nagios.
Tsar can be easily extended by writing modules, which makes it a powerful and versatile reporting tool.
tsar常见的命令行
- tsar -l -i 1 –cpu,每隔1s采集一次cpu的信息并输出到终端
$tsar -l -i 1 --cpu
Time -----------------------cpu----------------------
Time user sys wait hirq sirq util
31/05/18-10:35:30 0.50 0.16 0.00 0.00 0.00 0.66
31/05/18-10:35:31 0.25 0.03 0.00 0.00 0.00 0.28
- tsar –check –cpu,查看cpu最近一分钟的监控数据
$tsar --check --cpu
cdn-logging1.et2 tsar cpu:user=1.2 cpu:sys=0.1 cpu:wait=0.0 cpu:hirq=0.0 cpu:sirq=0.0 cpu:util=1.3
- tsar -D –traffic,查看详细的数据,不做KMG转化
$tsar --traffic -D|more
Time ---------------------traffic--------------------
Time bytin bytout pktin pktout pkterr pktdrp
30/05/18-10:40 8490769.00 6131262.00 7026.00 5328.00 0.00 0.00
30/05/18-10:45 8743606.00 5856453.00 7147.00 5174.00 0.00 0.00
30/05/18-10:50 7334951.00 5812603.00 6135.00 5002.00 0.00 0.00
30/05/18-10:55 8329520.00 6063059.00 6907.00 5277.00 0.00 0.00
- tsar -n 1,查看1天前的数据
- tsar -d 20180528,查看具体日期的数据
- tsar –cpu -s util,查看cpu模块的util字段数据
$tsar --cpu -s util|more
Time ---cpu--
Time util
30/05/18-10:45 7.91
30/05/18-10:50 6.96
30/05/18-10:55 7.68
30/05/18-11:00 7.67
- tsar -w 10,查看过去10分钟的tsar数据
发表评论