# Monitoring could not connect to elasticsearch, failed with xpack monitoring not available

**URL:** https://discuss.elastic.co/t/monitoring-could-not-connect-to-elasticsearch-failed-with-xpack-monitoring-not-available/124581
**Category:** Elasticsearch
**Created:** [March 19, 2018, 2:45pm UTC](https://discuss.elastic.co/t/monitoring-could-not-connect-to-elasticsearch-failed-with-xpack-monitoring-not-available/124581 "2018-03-19T14:45:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jasl](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@jasl](https://discuss.elastic.co/u/jasl)
#### Post date: [March 19, 2018, 2:45pm UTC](https://discuss.elastic.co/t/monitoring-could-not-connect-to-elasticsearch-failed-with-xpack-monitoring-not-available/124581/1 "2018-03-19T14:45:45Z")

</div>

So I have 2 ES clusters:

- Main:

- Monit

I can see monitoring data from Main in Monit's kibana (coming from ES itself), but in filebeat I get this error:

`Monitoring could not connect to elasticsearch, failed with xpack monitoring not available`

Seems like filebeat `xpack.monitoring.enabled` needs monitoring enabled in Monit cluster too. Is this a bug or a miss-configuration?

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [March 20, 2018, 6:25pm UTC](https://discuss.elastic.co/t/monitoring-could-not-connect-to-elasticsearch-failed-with-xpack-monitoring-not-available/124581/2 "2018-03-20T18:25:40Z")

</div>

Hi

Can you please share your Filebeat config as well. It will be easier to debug . Just the ES output sections (if applicable) and the xpack.monitoring section should be enough to further probe. Also is your `xpack.monitoring.elasticsearch.url` pointing to the `monitoring cluster`, but monitoring is `disabled` in that cluster. If so, it won't have the special bulk endpoint ?  
I talked with our developers on this issue, and they opine that in 7.0 it will be so much easier.

Cheers  
Rashmi

---

<div class="post-metadata">

### Author: ![jasl](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@jasl](https://discuss.elastic.co/u/jasl)
#### Post date: [March 21, 2018, 9:19am UTC](https://discuss.elastic.co/t/monitoring-could-not-connect-to-elasticsearch-failed-with-xpack-monitoring-not-available/124581/3 "2018-03-21T09:19:07Z")

</div>

I understand the issue now. Monitoring configuration in filebeat refers to monitoring filebeat itself, but it cannot do it if the Monit cluster has not monitoring enabled.

I guess this is a intentional decision, but this behaviour is different from elasticsearch itself (as you can save ES monitoring data in a cluster with no monitoring enabled)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 18, 2018, 9:19am UTC](https://discuss.elastic.co/t/monitoring-could-not-connect-to-elasticsearch-failed-with-xpack-monitoring-not-available/124581/4 "2018-04-18T09:19:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
