Zabbix使用Elasticsearch Cluster by HTTP监控

释放双眼,带上耳机,听听看~!

Zabbix Server 安装

Ubuntu 使用Docker compose快速部署Zabbix 6.4

Zabbix Agent 安装

Zabbix agent这里使用docker安装,如果不想安装zabbix_agent也可以的,因为es的数据是通过HTTP的方式获取,可以不安装Zabbix agent

 docker run  --name zabbix-agent -t   -v zabbix_agent:/etc/zabbix  -e ZBX_HOSTNAME="apisix-es"  -e ZBX_SERVER_HOST="192.168.0.10" -e ZBX_SERVER_PORT=10051 -p 10050:10050 --restart=unless-stopped --privileged -d zabbix/zabbix-agent:alpine-6.2-latest

#参数解释
ZBX_HOSTNAME Zabbix主机名,最好和外面的保持一致
ZBX_SERVER_HOST  Zabbix Server 地址
ZBX_SERVER_PORT  Zabbix Server端口号

ES安装

docker run --name es01 -p 9200:9200  -p 9300:9300 \
       -e "discovery.type=single-node"  -e ES_JAVA_OPTS="-Xms84m -Xmx512m"  -d elasticsearch:7.12.0

#如果需要持久化可以添加以下参数
   -v /home/es_docker/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
 -v /home/es_docker/data:/usr/share/elasticsearch/data 
 -v /home/es_docker/plugins:/usr/share/elasticsearch/plugins 

检查服务状态

[root@abcdocker ~]# docker ps|grep es01
d0cb70808be4   elasticsearch:7.12.0                              "/bin/tini -- /usr/l…"   2 minutes ago   Up 2 minutes           0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp   es01

Zabbix使用Elasticsearch Cluster by HTTP监控

修改Elasticsearch Cluster by HTTP模板

我们在Template App Elasticsearch Cluster by HTTP这个模板的监控项中发现以下五个监控项需要修改,3个是采集源监控项,2个是简单检查监控项,它们默认访问的是127.0.0.1,我们得改成可自定义配置IP

实际上就是将{HOST.CONN}替换为{$ELASTICSEARCH.IP}

监控项 类型 修改前URL 修改后URL
ES: Get cluster health HTTP代理 {$ELASTICSEARCH.SCHEME}://{HOST.CONN}:{$ELASTICSEARCH.PORT}/_cluster/health?timeout=5s {$ELASTICSEARCH.SCHEME}://{$ELASTICSEARCH.IP}:{$ELASTICSEARCH.PORT}/_cluster/health?timeout=5s
ES: Get cluster stats HTTP代理 {$ELASTICSEARCH.SCHEME}://{HOST.CONN}:{$ELASTICSEARCH.PORT}/_cluster/stats {$ELASTICSEARCH.SCHEME}://{$ELASTICSEARCH.IP}:{$ELASTICSEARCH.PORT}/_cluster/stats
ES: Get nodes stats HTTP代理 {$ELASTICSEARCH.SCHEME}://{HOST.CONN}:{$ELASTICSEARCH.PORT}/_nodes/stats {$ELASTICSEARCH.SCHEME}://{$ELASTICSEARCH.IP}:{$ELASTICSEARCH.PORT}/_nodes/stats
ES: Service response time 简单检查 net.tcp.service.perf["{$ELASTICSEARCH.SCHEME}","{HOST.CONN}","{$ELASTICSEARCH.PORT}"] net.tcp.service.perf["{$ELASTICSEARCH.SCHEME}","{$ELASTICSEARCH.IP}","{$ELASTICSEARCH.PORT}"]
ES: Service status 简单检查 net.tcp.service["{$ELASTICSEARCH.SCHEME}","{HOST.CONN}","{$ELASTICSEARCH.PORT}"] net.tcp.service["{$ELASTICSEARCH.SCHEME}","{$ELASTICSEARCH.IP}","{$ELASTICSEARCH.PORT}"]

Zabbix中替换url即可,记得点击保存

Zabbix使用Elasticsearch Cluster by HTTP监控

Zabbix Agent配置

Zabbix使用Elasticsearch Cluster by HTTP监控

选择ES监控模板

Zabbix使用Elasticsearch Cluster by HTTP监控

添加主机宏

{$ELASTICSEARCH.IP}

#这里的IP为ES IP

Zabbix使用Elasticsearch Cluster by HTTP监控

这里就可以看到已经获取到最新数据了
Zabbix使用Elasticsearch Cluster by HTTP监控

Zabbix使用Elasticsearch Cluster by HTTP监控

给TA打赏
共{{data.count}}人
人已打赏
RabbitMQZabbix

Zabbix 使用RabbitMQ node by Zabbix agent监控RabbitMQ

2024-1-4 17:51:55

Cloud

云计算与虚拟化工具之KVM

2016-10-28 11:49:26

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索