gtxyzz

Tsar安装配置

gtxyzz linux 2023-01-25 400浏览 0

下载:
# wget http://code.taobao.org/p/tsar/file/1787/tsar-2.1.0.tar.gz
安装:
# tar zxvf tsar-2.1.0.tar.gz
# cd tsar-2.1.0
# ./configure –prefix=/usr/local/tsar (新版本的需要执行这一步,老版本的直接不需要执行此步)
# make && make install
配置文件详解:
1、主配置文件路径:/etc/tsar/tsar.conf
#debug_level(INFO DEBUG WARN ERROR FATAL)
debug_level FATAL    ##指定tsar的运行级别,主要用来调试使用
#[module] on/off to enable mod    ##开启指定模块
mod_cpu on
mod_mem on
mod_swap on
mod_tcp on
mod_udp on
mod_traffic on
mod_io on
mod_pcsw on
mod_partition on
mod_tcpx on
mod_load on

#output type:file,nagios,db
output_interface file,nagios    ##设置输出类型,支持file,nagios,db

#[output_file] original data to store
output_file_path /var/log/tsar.data    ##设置文件类型输出的写入文件

#[output_stdio] these mod will be show as using tsar
output_stdio_mod mod_swap,mod_partition,mod_cpu,mod_mem,mod_traffic,mod_load,mod_tcp,mod_udp,mod_tcpx,mod_pcsw,mod_io    ##设置用户终端默认显示的模块

#[output_nagios] the alert will be report to nagios server
output_nagios_mod mod_swap,mod_partition,mod_cpu,mod_mem,mod_traffic,mod_load,mod_tcp,mod_udp,mod_tcpx,mod_pcsw,mod_io    ##设置哪些模块输出到nagios

#[output_db]
#output_db_mod mod_swap,mod_partition,mod_cpu,mod_mem,mod_traffic,mod_load,mod_tcp,mod_udp,mod_tcpx,mod_pcsw,mod_io    ##设置哪些模块输出到数据库
#output_db_addr console2:56677

#support include other mod conf
include /etc/tsar/conf.d/*.conf    ##支持include配置,主要用来加载用户的自定义模块

2、nagios配置文件路径:/etc/tsar/nagios.conf
#The IP address of the host running the NSCA daemon
server_addr mmdev4.corp.alimama.com
#The port on which the daemon is running – default is 5667
server_port 8086
#The cycle of send alert to nagios
cycle_time 300    ##指定上报的间隔时间,由于tsar每一分钟采集一次,上报时会判断是否符合时间间隔,如设置300的话,则在0,5等整点分钟会上报nagios
#nsca client program
send_nsca_cmd /usr/bin/send_nsca
send_nsca_conf /home/a/conf/amon/send_nsca.conf

#tsar mod alert config file
#threshold [hostname.]servicename.key;w-min;w-max;c-min;cmax;    ##设置某个要报警项的阀值,前面是模块和要监控的具体名称,后面的四个数据代表报警的范围,warn和critical的范围
threshold apache.qps;N;N;N;N;
threshold apache.rt;N;N;N;N;
threshold cpu.util;N;N;N;N;
threshold mem.util;N;N;N;N;
threshold load.load1;N;N;N;N;
threshold load.load5;N;N;N;N;
threshold load.load15;N;N;N;N;
threshold io.sda.util;N;N;N;N;
threshold traffic.bytin;N;N;N;N;
threshold traffic.bytout;N;N;N;N;
threshold tcp.retran;N;N;N;N;
threshold partition./.util;N;N;N;N;
threshold partition./var.util;N;N;N;N;
threshold partition./home.util;N;N;N;N;
threshold partition./boot.util;N;N;N;N;

转载请注明:IT运维空间 » linux » Tsar安装配置

继续浏览有关 LINUX技术 的文章
发表评论