# How to identify if monitoring is enabled or disabled for all HOSTS in one call?

**URL:** <https://community.dynatrace.com/t/how-to-identify-if-monitoring-is-enabled-or-disabled-for-all-hosts-in-one-call/31625>\
**Category:** Dynatrace API\
**Tags:** hosts-classic, dynatrace-api\
**Created:** [May 27, 2021, 2:37pm UTC](https://community.dynatrace.com/t/how-to-identify-if-monitoring-is-enabled-or-disabled-for-all-hosts-in-one-call/31625 "2021-05-27T14:37:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ingrida](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ingrida/32/13926_2.png) [@Ingrida](https://community.dynatrace.com/u/Ingrida)\
**Post date:** [May 27, 2021, 2:37pm UTC](https://community.dynatrace.com/t/how-to-identify-if-monitoring-is-enabled-or-disabled-for-all-hosts-in-one-call/31625/1 "2021-05-27T14:37:34Z")

</div>

Hi,

We are working on ability to enable/disable monitoring for multiple Hosts at once and need a way to identify current monitoring status for all Hosts in environment.

with fields=+properties.monitoringMode in&nbsp;/api/v2/entities call we can easily to identify monitoring mode, however, only way we found so far to identify if monitoring is enabled or not is to call&nbsp;/api/config/v1/hosts/ API for every single HOST.

Is there any better way to do this? not doing 5000 calls for 5000 Hosts?

Thanks!

I.

---

<div class="post-metadata">

**Author:** ![JamesKitson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jameskitson/32/22460_2.png) [@JamesKitson](https://community.dynatrace.com/u/JamesKitson)\
**Post date:** [May 27, 2021, 6:53pm UTC](https://community.dynatrace.com/t/how-to-identify-if-monitoring-is-enabled-or-disabled-for-all-hosts-in-one-call/31625/2 "2021-05-27T18:53:36Z")

</div>

If you use the V1 SmartScape - Hosts API it includes monitoring mode in the response if you select to include details:&nbsp;[https://www.dynatrace.com/support/help/shortlink/api-hosts-get-all#response-body](https://www.dynatrace.com/support/help/shortlink/api-hosts-get-all#response-body)

---

<div class="post-metadata">

**Author:** ![Ingrida](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ingrida/32/13926_2.png) [@Ingrida](https://community.dynatrace.com/u/Ingrida)\
**Post date:** [June 1, 2021, 8:57am UTC](https://community.dynatrace.com/t/how-to-identify-if-monitoring-is-enabled-or-disabled-for-all-hosts-in-one-call/31625/3 "2021-06-01T08:57:45Z")

</div>

Hi James,

Thanks for information. I have tow painpoints with this solution:

- it is v1 API. Will it be kept for the future?

- it allows me to get information for one HOST. SO, if I have 10.000 hosts I have to loop it 10.000 times if I need to get an overview about status.

it is not a problem to get Monitoring mode with v2 entities call as it is part of entity Type HOST properties. However, I am talking about monitoringEnable property for which I would need to use v1 call in loop… 😞

Any other option?

Thanks!

I.

---

<div class="post-metadata">

**Author:** ![JamesKitson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jameskitson/32/22460_2.png) [@JamesKitson](https://community.dynatrace.com/u/JamesKitson)\
**Post date:** [June 1, 2021, 2:12pm UTC](https://community.dynatrace.com/t/how-to-identify-if-monitoring-is-enabled-or-disabled-for-all-hosts-in-one-call/31625/4 "2021-06-01T14:12:09Z")

</div>

The API I linked returns multiple hosts, II just verified that, not one so it won’t need a separate call to get every host. I’m not aware of any plans to get rid of any v1 endpoints, most likely they just won’t get any enhancements.

---

<div class="post-metadata">

**Author:** ![Ingrida](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ingrida/32/13926_2.png) [@Ingrida](https://community.dynatrace.com/u/Ingrida)\
**Post date:** [June 2, 2021, 7:00am UTC](https://community.dynatrace.com/t/how-to-identify-if-monitoring-is-enabled-or-disabled-for-all-hosts-in-one-call/31625/5 "2021-06-02T07:00:58Z")

</div>

hi James, you are absolutelly right, sorry for confusion,&nbsp;/api/v1/entity/infrastructure/hosts returns all hosts, however, it doesnot return monitoringEnable property, just monitoringMode.

However, I found meanwhile that&nbsp;/api/v1/oneagents is able toprovide this information via&nbsp;configuredMonitoringEnabled property, hence my problem too get montoringenabled state for all hosts in one call is solved by now.

Thanks for support!

I.
