姓名:刘浩然。 2020年大目标Python

监控elssticSearch健康状态

[4ajr@elk1 scripts]$ curl 172.30.210.175:9200/_cat/health 

[4ajr@elk1 scripts]$ cat check_es_healthy.py 

import commands

command = '172.30.210.175:9200/_cat/health'

(a, b) = commands.getstatusoutput(command)

status = b.split(' ')

if status=='red':

    healthy=0

else:

    healthy=1

 

 

print healthy

 

 

UserParameter=es_healthy,python /soft/zabbix_agent/scripts/check_es_healthy.py

 

zabbix模板,应用集,监控项,报警,图形

posted @ 2019-02-03 10:10  pluto2charon  阅读(292)  评论(0编辑  收藏  举报