ElasticSearch 可以直接使用zabbix官方的模板
模板地址:
https://github.com/mkhpalm/elastizabbix
通过zabbix server 直接监控
1、下载模板文件导入模板
2、把模板关联到zabbix server
3、添加自定义KEY
vim /etc/zabbix/scripts/elastizabbix.py
#!/usr/bin/python
import os
import sys
import json
import urllib2
import time
import errno
ttl = 60
#url更换成你的es地址
stats = {
‘cluster‘: ‘http://elasticsearch.es.cn:19200/_cluster/stats‘,
‘nodes‘ : ‘http://elasticsearch.es.cn:19200/_nodes/stats‘,
‘indices‘: ‘http://elasticsearch.es.cn:19200/_stats‘,
‘health‘ : ‘http://elasticsearch.es.cn:19200/_cluster/health‘
}
vim /etc/zabbix/zabbix_agentd.d/es.conf UserParameter=elastizabbix[*],/etc/zabbix/scripts/elastizabbix.py $1 $2

原文:http://www.cnblogs.com/37yan/p/7095853.html