logstash结合zabbix报警安装部署
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了logstash结合zabbix报警安装部署相关的知识,希望对你有一定的参考价值。
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报警安装部署的主要内容,如果未能解决你的问题,请参考以下文章