您的位置 首页 elasticsearch

zabbix 监控ES

zabbix 监控ES

客户端要安装 zabbix: https://www.baimeidashu.com/8883.html

获取es 节点状况:

curl 10.0.0.113:19200/_cat/nodes
curl 10.0.0.113:19200/_cluster/health 2>/dev/null |jq

 

一 、 客户端配置 , 10.0.0.111

(1)配置  /etc/zabbix/zabbix_agentd.conf 文件

egrep -v "^#|^$" /etc/zabbix/zabbix_agentd.conf

 

(2) 添加监控参数 配置文件  *.conf

cd /etc/zabbix/zabbix_agentd.d
vim esstatus.conf
[root@baimeidashu-elk111 /etc/zabbix/zabbix_agentd.d]#cat esstatus.conf 
UserParameter=login_number,w|awk 'NR==1{print $(NF-6)}'
UserParameter=escluster_number,curl 10.0.0.113:19200/_cat/nodes 2>/dev/null |wc -l

查看监控项 zabbix_agentd -p 有语法检测功能

zabbix_agentd -p|grep escluster_number

上述没问题,就可以

重启

systemctl restart zabbix-agent.service

 

二、服务端配置

(1) 创建主机

 

 

(2) 添加监控项

然后可以测试一下,是否可以获取 escluster_number 的值

(3)报警信息设置

 

(4) 设置邮件报警:

 

之后再配置一下 : 操作

 


esstatus.conf

UserParameter=login_number,w|awk 'NR==1{print $(NF-6)}'
UserParameter=escluster_number,curl 10.0.0.111:19200/_cat/nodes 2>/dev/null |wc -l
UserParameter=cluster_name,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .cluster_name
UserParameter=status,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .status
UserParameter=time_out,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .time_out
UserParameter=number_of_nodes,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .number_of_nodes
UserParameter=number_of_data_nodes,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .number_of_data_nodes
UserParameter=active_primary_shards,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .active_primary_shards
UserParameter=active_shards,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .active_shards
UserParameter=relocating_shards,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .relocating_shards
UserParameter=initializing_shards,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .initializing_shards
UserParameter=unassigned_shards,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .unassigned_shards
UserParameter=delayed_unassigned_shards,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .delayed_unassigned_shards
UserParameter=number_of_pending_tasks,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .number_of_pending_tasks
UserParameter=number_of_in_flight_fetch,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .number_of_in_flight_fetch
UserParameter=task_max_waiting_in_queue_millis,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .task_max_waiting_in_queue_millis
UserParameter=active_shards_percent_as_number,curl 10.0.0.111:19200/_cluster/health 2>/dev/null | jq -r .active_shards_percent_as_number

 

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章