cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

V2 API - Get Platform and Get Number of CPUs

louis_gallo
Helper

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

7 REPLIES 7

axel_ayala
Dynatrace Advisor
Dynatrace Advisor

You can use the Monitoring Entities API, here you can find the osType, logicalCpuCores and cpuCores parameters with the info you are looking for:

axel_ayala_0-1646299016445.png

 

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.

Hi,

You can use Monitored entities API.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

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.

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

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

hi, 

when you get into  API V2  search  for entities 

Saharnir_0-1698830946796.png 

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 

 

 

Featured Posts