mkhpalm / elastizabbix

Zabbix plugin for monitoring elastic / elasticsearch
68 stars 57 forks source link

In Zabbix 3.0 all the items/discovery remain Not supported #9

Open kaloyan-s opened 8 years ago

kaloyan-s commented 8 years ago

Hi Mike,

In zabbix 3.0 neither of the items is active. All remain not supported. When I run the script i got this:

Mypc:/etc/zabbix/scripts# ./elastizabbix Traceback (most recent call last): File "./elastizabbix", line 68, in api = sys.argv[1] IndexError: list index out of range

Can you help ?

kirkwor commented 7 years ago

@kaloyan-s , you most likely figure it out by now that you're not suppose to use the script directly, but with some values e.g.:

# ./elastizabbix indices _all.total.search.query_time_in_millis
3312
#  ./elastizabbix health active_primary_shards
20

For some reason this posted before I finished. Anyway, I've just installed it with Zabbix 3.2 and it loads them fine, also discovery works. I did had to install some python modules "urllib2-file/simplejson" to get it going from a default Centos installation.

Some of the checks require permission in /tmp folder, some tmp folders have sticky bit by default, so you might need to change some permissions, however Zabbix is good on letting you know what the issue is from the logs (debug logs if needed).

latundetoks commented 7 years ago

Hey @kirkwor,

Do you mind elaborating abit on how the issue was solved?. For some reasons im having similar challenges configuring EC nodes on Centos7.

Does it require python-simplejson module for urllib2-file to work?

./elastizabbix health active_primary_shards

Traceback (most recent call last): File "./elastizabbix", line 88, in stat = get_stat(api, stat) File "./elastizabbix", line 55, in get_stat d = get_cache(api) File "./elastizabbix", line 51, in get_cache ret_data = json.loads(urllib2.urlopen(stats[api]).read()) File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/usr/lib64/python2.7/urllib2.py", line 431, in open response = self._open(req, data) File "/usr/lib64/python2.7/urllib2.py", line 449, in _open '_open', req) File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain result = func(*args) File "/usr/lib64/python2.7/urllib2.py", line 1244, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib64/python2.7/urllib2.py", line 1214, in do_open raise URLError(err) urllib2.URLError: <urlopen error [Errno 113] No route to host>

kirkwor commented 7 years ago

@latundetoks that is correct, in my case by default I had no json module so I had to install python-simplejson (pip install simplejson) to get it to work for me. In your case, if the error is correct, I think it refers to wrong ES host specified?