# Failed to monitor mongo cluster

**URL:** <https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [June 29, 2022, 10:26am UTC](https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453 "2022-06-29T10:26:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maksym\_Postument](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maksym_postument/32/106661_2.png) [@Maksym\_Postument](https://discuss.elastic.co/u/Maksym_Postument)\
**Post date:** [June 29, 2022, 10:26am UTC](https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453/1 "2022-06-29T10:26:17Z")

</div>

I have multiple hosts specified in hosts like this `hosts: ["ip1:port1", "ip2:port1"]`.

But metricbeats showing error like this. How can i configure it to work correctly  
fetching data for metricset mongodb.dbstats: could not create mongodb client: could not create mongodb client: a direct connection cannot be made if multiple hosts are specified li

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [July 4, 2022, 12:42pm UTC](https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453/2 "2022-07-04T12:42:43Z")

</div>

Hey @Maksym_Postument, what version of Metricbeat are you using?

I was looking to the code and found that there may be a regression in 8.3 for these cases where multiple hosts are configured. I have opened an issue for investigation: [MongoDB metricsets incorrectly handling multiple hosts · Issue #32188 · elastic/beats · GitHub](https://github.com/elastic/beats/issues/32188)

---

<div class="post-metadata">

**Author:** ![Maksym\_Postument](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maksym_postument/32/106661_2.png) [@Maksym\_Postument](https://discuss.elastic.co/u/Maksym_Postument)\
**Post date:** [July 4, 2022, 1:00pm UTC](https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453/3 "2022-07-04T13:00:23Z")

</div>

Hello, i i am using version 8.3.0

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [July 4, 2022, 1:01pm UTC](https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453/4 "2022-07-04T13:01:22Z")

</div>

Were you upgrading from a previous version of Metricbeat? Did it work for you then?

---

<div class="post-metadata">

**Author:** ![Maksym\_Postument](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maksym_postument/32/106661_2.png) [@Maksym\_Postument](https://discuss.elastic.co/u/Maksym_Postument)\
**Post date:** [July 4, 2022, 1:02pm UTC](https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453/5 "2022-07-04T13:02:51Z")

</div>

Last when i tested 8.2.3 it was working correctly

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [July 4, 2022, 1:05pm UTC](https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453/6 "2022-07-04T13:05:05Z")

</div>

Ok, this would confirm that this is a regression in 8.3. Thanks!

---

<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:** [August 1, 2022, 3:05pm UTC](https://discuss.elastic.co/t/failed-to-monitor-mongo-cluster/308453/7 "2022-08-01T15:05:38Z")

</div>

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