码迷,mamicode.com
首页 > 其他好文 > 详细

logstash结合zabbix报警安装部署

时间:2017-08-23 13:33:31      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:zabbix报警   grok   oba   mamicode   tail   com   -o   .com   detail   

cd /usr/share/logstash/
vim Gemfile
source "https://ruby.taobao.org/" ##修改成国内镜像站
source "https://gems.ruby-china.org/" ##修改成国内镜像站
 
bin/logstash-plugin install logstash-output-zabbix ##安装logstash-output-zabbix
 
 
 
/usr/bin/zabbix_sender -z 172.25.11.98 -p 10051 -s 172.25.11.77 -k zabbix_key -o "hello world"
 
zabbix_server -R config_cache_reload
 
zabbix_proxy -R config_cache_reload
 
vim test.conf
 
input {
file {
path => "/root/nginx.log"
start_position => "beginning"
type => "nginx.log"
}
}
 
 
filter {
grok {
match => [ "message", "(error|ERROR|CRITICAL)" ]
add_tag => [ "zabbix-sender" ]
add_field => [
"zabbix_host", "200.3.199.213",
"zabbix_key", "zabbix_key"
]
}
}
 
output {
if "zabbix-sender" in [tags] {
zabbix{
zabbix_host => "zabbix_host"
zabbix_key => "zabbix_key"
zabbix_server_host => "200.3.199.153"
zabbix_server_port => "10051"
zabbix_value => "message"
}
}
}
 
Logstash整合zabbix 过滤Nginx 错误日志并进行报警zabbix配置 http://www.mamicode.com/info-detail-1809812.html
 

logstash结合zabbix报警安装部署

标签:zabbix报警   grok   oba   mamicode   tail   com   -o   .com   detail   

原文地址:http://www.cnblogs.com/zhaishaomin/p/7417293.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!