16 Feb 2022 02:09 PM
Which API do I use to get the configuration for an host entity. I am particularly interested in the number of CPUs, and in the platform (Windows, Linux, other).
Any help would be greatly appreciated.
Lou
Solved! Go to Solution.
03 Mar 2022 09:17 AM
You can use the Monitoring Entities API, here you can find the osType, logicalCpuCores and cpuCores parameters with the info you are looking for:
03 Mar 2022 01:41 PM
Thank you. I have already started using that API to get this information.
11 Jul 2023 06:27 PM
So what's the actual API query to get this?
Their documentation has no examples in the EntitySelector section and this is the only google result I get for how to get this data, but I don't actually know what the API call is to get this returned.
11 Jul 2023 11:07 PM - edited 11 Jul 2023 11:08 PM
12 Jul 2023 02:45 PM
Yes, I can see that in the comment I replied to... My question was more what the exact query was because there are no good examples of using the Monitored Entities API in their documentation. There's little snippets here and there, but no full examples like they provide in their Metrics API docs.
12 Jul 2023 03:17 PM - last edited on 13 Jul 2023 08:44 AM by MaciejNeumann
Hi,
For example, you make a GET request against "https://{environmentid}.live.dynatrace.com/api/v2/entities?pageSize=200&entitySelector=type("HOST")"
And you received host list:
{
"totalCount": 1,
"pageSize": 200,
"entities": [
{
"entityId": "HOST-XXXXXXXXXXXXXXXX",
"type": "HOST",
"displayName": "YYYYYYYYY"
}
]
}
Using entityId, you can get more details makinng another GET request against "https://{environmentid}.live.dynatrace.com/api/v2/entities/HOST-XXXXXXXXXXXXXXXX".
Best regards
01 Nov 2023 09:36 AM - edited 01 Nov 2023 09:41 AM
hi,
when you get into API V2 search for entities
you have field call : entityselector, put the parameter type("host")
seconded field call : fields, put the parameter properties.logicalCpuCores,properties.cpucores,properties.ostype
that give you the CPU cores ,CPU logical cores and operation system
**when you run that API from the Dynatrace you will get a window with the query that you can use later on