dkanbier/zabbix-elasticsearch

Basic user auth with Search Guard

Opened this issue · 1 comments

Does anyone know a way to authenticate user created with Search Guard (or X-Pack, whatever)?

I have 3-node elasticsearch cluster. I installed zabbix-elasticsearch and try to connect to ES cluster. But the problem is that zabbix-elasticsearch does not have permission to get cluster stats or health. The problem is here:

# Try to establish a connection to elasticsearch
try:
  conn = Elasticsearch(['http://localhost:9200'])
except Exception, e:
  zbx_fail()

I tried something like that:

# Try to establish a connection to elasticsearch
try:
  conn = Elasticsearch(['http://admin:admin@localhost:9200'])
except Exception, e:
  zbx_fail()

But it does not work. Is there any way to walk around this issue?

Actually thats an interesting question! I'll try to investigate this somewhere this week. According to the documentation of both Elastic and the ES python module your example should work:

https://www.elastic.co/guide/en/x-pack/current/http-clients.html
http://elasticsearch-py.readthedocs.io/en/master/#ssl-and-authentication