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.
You can use the Monitoring Entities API, here you can find the osType, logicalCpuCores and cpuCores parameters with the info you are looking for:
Thank you. I have already started using that API to get this information.
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.
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
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