12 Aug 2021 07:28 AM - last edited on 21 Aug 2024 10:26 AM by Michal_Gebacki
Hi,
how to get the exact same number of hosts detected by Dynatrace. The same number as the one displayed on the attached screenshot (/#settings/deployment/newhostslist)
I can't find an API that does this.
Thank You.
Solved! Go to Solution.
12 Aug 2021 12:37 PM - edited 12 Aug 2021 12:38 PM
Hello @_Fabian_
If I understand well, i found the solution for you.
The only way that I see, is to use the API.
Using this call 'Gets the list of hosts with OneAgent deployment information for each host'
If your disabling was made since long time, don't forget to change the start time frame: and now with the integer as an entry (with a maximum of 92 days I think).
If you need more assistance not hesitate.
12 Aug 2021 12:55 PM
Thank you for the answer. 92 days is far too short. I would need to be able to get the information regardless of the time frame. In fact, I need to get all the hosts on which a watchdog is running.
12 Aug 2021 01:12 PM
What you can do is to list all the hosts in Dynatrace Via the API. and from that GET Command, you can also include or choose to exclude monitoring candidates that Dynatrace sees.
12 Aug 2021 02:12 PM
Unfortunately, it doesn't work.The API returns 1093 hosts when I expect 2060. This is not really surprising since the smartscape does not display known but unmonitored hosts (unless I'm mistaken). But thanks anyway.
12 Aug 2021 02:16 PM
You may need to increase the payload output as in my tests we get the full output of all hosts. with monitoring candidates excluded
12 Aug 2021 02:25 PM
I try through the Dynatrace interface. I don't put a limit in the size of the page. Is there any other way to increase the payload?
12 Aug 2021 03:27 PM
Ok, I think I've got it (1 year is enough and it returns more than 2000 hosts) :
/api/v2/entities?pageSize=3000&entitySelector=type%28%22HOST%22%29&from=now-1y&to=now&fields=properties.STATE
Thank you for your help.
12 Aug 2021 03:31 PM
You're welcome. some people use postman as well as they can gain a larger output since the API UI in Dynatrace can crash and such. Glad to hear that its working as expected 🙂