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

How obtein threshold for every host by API

DAVID_MTZ
Contributor

Good morning Dynatrace team

 

Is possible obtein the thresholds that are available for every HOST monitored via API?

I need to obtein one list of every monitored host and the threshold configured for every one. Is possible this? one idea?

 

Thanks

1 REPLY 1

Kor01
Helper

Hi! There isn't a direct endpoint for this that I'm aware of, but if you string a few calls together you can get the data:

  1. Use the Environment API to get a list of hosts using an Entity Selector. For every host in the environment, a simple `type("HOST")` should work
  2. Use the Settings API and hit the builtin:anomaly-detection.infrastructure-hosts schema to get the default Environment level settings. Individual hosts will override this setting if they have anomaly detection defined.
  3. Loop through the list of host IDs and make GET requests to the Settings API and passing in the host ID. If the host has anomaly detection settings that differ from the default Environment settings, they will be returned in the results. If not, then its using the default Environment settings.

Featured Posts