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

How to get entities only that have problems using API?

jamstelus
Newcomer

Does anyone know how to get a list of entities that have problems "only"? 

What endpoint to be used with parameters? if it is possible please show me example, 

Thanks

3 REPLIES 3

michiel_otten
Mentor

Do you mean the only entities that have open problems? If so: you could you the normal problem api. These APIs give information about impacted entities / root causes etcetera. 

Using a small script you can easily get a result that provides exactly what you'll need.

https://www.dynatrace.com/support/help/dynatrace-api/environment-api/problems-v2/problems/get-proble...

 

Kind regards,

Michiel 

#Performance matter!

McVitas
Participant

Hello. I am trying similar thing: I want to list all open problems but only with some fields. I want problem title and hostname. Unfortunately I can't get the hostname into the resulting JSON. I tried name, hostname, but it doesn't put it there and I get result completely without hostnames or with hostnames but also with many other information which I don't want. The best thing would be to be able to get a CSV format result, but I guess this is not possible?

michiel_otten
Mentor

Hi there, 

So basically the API gives you a LOT of field. You can't reduce this according to the documentation:

A list of additional problem properties you can add to the response.

The following properties are available (all other properties are always included and you can't remove them from the response😞

  • evidenceDetails: The details of the root cause.
  • impactAnalysis: The impact analysis of the problem on other entities/users.
  • recentComments: A list of the most recent comments to the problem.

To add properties, specify them as a comma-separated list (for example, evidenceDetails,impactAnalysis).


Second part is the question about HOST. What do you want to know exactly? The root cause?
In the JSON response there will be something like this:

rootCauseEntity": {        "entityId": {          "id": "PROCESS_GROUP-511F9ECC59F68DD4",          "type": "PROCESS_GROUP"
        },
        "name": "Oracle Database"
      }

 In case this is a HOST, you will have the host ID there.  If you want to customize something to XML, you'll probably need to write a simple custom script. 

by the way: adding field evidenceDetails can give you more infomation about the host. 

#Performance matter!

Featured Posts