Header image
 
Taobao System Activity Reporter  
line decor
  
line decor


 


 
 

What is Tsar About?

Introduction ------------ Tsar (Taobao System Activity Reporter) is a monitoring tool, which can be used to

Introduction

Plesase go to github: https://github.com/alibaba/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.

Module introduction: modules info

Installation

Tsar is available on GitHub, you can clone and install it as follows:


	$ git clone git://github.com/alibaba/tsar.git
	$ cd tsar
	$ make
	$ make install
	

Or you can download the zip file and install it:


	$ wget -O tsar.zip https://github.com/alibaba/tsar/archive/master.zip --no-check-certificate
	$ unzip tsar.zip
	$ cd tsar
	$ make
	$ make install
	

After installation, you may see these files:

  • /etc/tsar/tsar.conf, which is tsar's main configuration file;
  • /etc/cron.d/tsar, is used to run tsar to collect information every minute;
  • /etc/logrotate.d/tsar will rotate tsar's log files every month;
  • /usr/local/tsar/modules is the directory where all module libraries (*.so) are located;

Configuration

There is no output displayed after installation by default. Just run tsar -l to see if the real-time monitoring works, for instance, display status every second(-i 1)


	[kongjian@tsar]$ tsar -l -i 1
	Time              ---cpu-- ---mem-- ---tcp-- -----traffic---- --xvda-- -xvda1-- -xvda2-- -xvda3-- -xvda4-- -xvda5--  ---load-
	Time                util     util   retran    pktin  pktout     util     util     util     util     util     util     load1
	11/04/13-14:09:10   0.20    11.57     0.00     9.00    2.00     0.00     0.00     0.00     0.00     0.00     0.00      0.00
	11/04/13-14:09:11   0.20    11.57     0.00     4.00    2.00     0.00     0.00     0.00     0.00     0.00     0.00      0.00
	

Usually, we configure Tsar by simply editing /etc/tsar/tsar.conf:

  • To add a module, add a line like mod_<yourmodname> on
  • To enable or disable a module, use mod_<yourmodname> on/off
  • To specify parameters for a module, use mod_<yourmodname> on parameter
  • output_stdio_mod is to set modules output to standard I/O
  • output_file_path is to set history data file, (you should modify the logrotate script /etc/logrotate.d/tsar too)
  • output_interface specifies tsar data output destination, which by default is a local file. See the Advanced section for more information.

Usage

  • null :see default mods history data, tsar
  • --modname :specify module to show, tsar --cpu
  • -L/--list :list available moudule, tsar -L
  • -l/--live :show real-time info, tsar -l --cpu
  • -i/--interval :set interval for report, tsar -i 1 --cpu
  • -s/--spec :specify module detail field, tsar --cpu -s sys,util
  • -D/--detail :do not conver data to K/M/G, tsar --mem -D
  • -m/--merge :merge multiply item to one, tsar --io -m
  • -I/--item :show spec item data, tsar --io -I sda
  • -d/--date :specify data, YYYYMMDD, or n means n days ago
  • -C/--check :show the last collect data
  • -h/--help :show help, tsar -h

More

Homepage http://tsar.taobao.org

Any question, please feel free to contact me by kongjian@taobao.com

-------------------------
 
 

News
2011/1/12 | Used at taobao
2011/5/24 | Opensources day
2013/1/16 | Github

 

Job opportunities
Aliyun @Hangzhou @Beijing @Shanghai @US See more