zabbix监控es集群健康状态(python2.7)
import commands,re
command = 'curl xxx.xxx.xxx.xxx:9200/_cat/health'
a,b=commands.getstatusoutput(command)
if re.search('green',b):
x=1
elif re.search('red',b):
x=2
else:
x=3
print x
返回1:为健康
返回2:有节点损坏,
返回3:数据丢失
There are no shortcuts to any place worth going. -- Beverly Sills