Elasticsearch-zabbix
Elasticsearch-zabbix copied to clipboard
ESzabbix.py don't return 0 when ES is down.
Hello!
I ran ES 1.7.1 and zabbix 2.4, I just install your monitor scripts and face such issue: when ES is down script returns an exception (but as I understand it should just return 0 in that case)
File "/etc/zabbix/scripts/ESzabbix.py", line 168, in <module>
if conn.ping():
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/utils.py", line 69, in _wrapped
return func(*args, params=params, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/__init__.py", line 190, in ping
self.transport.perform_request('HEAD', '/', params=params)
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py", line 307, in perform_request
status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/http_urllib3.py", line 89, in perform_request
raise ConnectionError('N/A', str(e), e)
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f2efa6ecf50>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f2efa6ecf50>: Failed to establish a new connection: [Errno 111] Connection refused)
Because of that zabbix' trigger didn't switch.