• Home
  • Dynatrace API
  • Configuration
  • Anomaly detection
  • Hosts
  • PUT configuration

Host anomaly detection API - PUT configuration

Updates the configuration of anomaly detection for hosts.

The request consumes an application/json payload.

PUTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/hosts
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/hosts
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/hosts

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodyHostsAnomalyDetectionConfig

The JSON body of the request. Contains parameters of the host anomaly detection configuration.

bodyoptional

Request body objects

The HostsAnomalyDetectionConfig object

Configuration of anomaly detection for hosts.

ElementTypeDescription
metadataConfigurationMetadata

Metadata useful for debugging

Can be null.

connectionLostDetectionConnectionLostDetectionConfig

Configuration of lost connection detection.

highCpuSaturationDetectionHighCpuSaturationDetectionConfig

Configuration of high CPU saturation detection

highMemoryDetectionHighMemoryDetectionConfig

Configuration of high memory usage detection.

highGcActivityDetectionHighGcActivityDetectionConfig

Configuration of high Garbage Collector activity detection.

outOfMemoryDetectionOutOfMemoryDetectionConfig

Configuration of Java out of memory problems detection.

outOfThreadsDetectionOutOfThreadsDetectionConfig

Configuration of Java out of threads problems detection.

networkDroppedPacketsDetectionNetworkDroppedPacketsDetectionConfig

Configuration of high number of dropped packets detection.

networkErrorsDetectionNetworkErrorsDetectionConfig

Configuration of high number of network errors detection.

highNetworkDetectionHighNetworkDetectionConfig

Configuration of high network utilization detection.

networkTcpProblemsDetectionNetworkTcpProblemsDetectionConfig

Configuration of TCP connectivity problems detection.

networkHighRetransmissionDetectionNetworkHighRetransmissionDetectionConfig

Configuration of high retransmission rate detection.

diskLowSpaceDetectionDiskLowSpaceDetectionConfig

Configuration of low disk space detection.

diskSlowWritesAndReadsDetectionDiskSlowWritesAndReadsDetectionConfig

Configuration of slow running disks detection.

diskLowInodesDetectionDiskLowInodesDetectionConfig

Configuration of low disk inodes number detection.

The ConfigurationMetadata object

Metadata useful for debugging

ElementTypeDescription
configurationVersionsinteger[]

A sorted list of the version numbers of the configuration.

Can be null.

currentConfigurationVersionsstring[]

A sorted list of version numbers of the configuration.

Can be null.

clusterVersionstring

Dynatrace version.

Can be null.

The ConnectionLostDetectionConfig object

Configuration of lost connection detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

enabledOnGracefulShutdownsboolean

Alert (true) on graceful host shutdowns.

The HighCpuSaturationDetectionConfig object

Configuration of high CPU saturation detection

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsHighCpuSaturationThresholds

Custom thresholds for high CPU saturation. If not set then the automatic mode is used.

Can be null.

The HighCpuSaturationThresholds object

Custom thresholds for high CPU saturation. If not set then the automatic mode is used.

ElementTypeDescription
cpuSaturationinteger

Alert if CPU usage is higher than X% in 3 out of 5 samples.

The HighMemoryDetectionConfig object

Configuration of high memory usage detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsHighMemoryThresholds

Custom thresholds for high memory usage. If not set then the automatic mode is used.

Both conditions must be met to trigger an alert.

Can be null.

The HighMemoryThresholds object

Custom thresholds for high memory usage. If not set then the automatic mode is used.

Both conditions must be met to trigger an alert.

ElementTypeDescription
pageFaultsPerSecondWindowsinteger

Memory page fault rate is higher than X faults per second on Windows.

usedMemoryPercentageWindowsinteger

Memory usage is higher than X% on Windows.

pageFaultsPerSecondNonWindowsinteger

Memory page fault rate is higher than X faults per second on Linux.

usedMemoryPercentageNonWindowsinteger

Memory usage is higher than X% on Linux.

The HighGcActivityDetectionConfig object

Configuration of high Garbage Collector activity detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsHighGcActivityThresholds

Custom thresholds for high GC activity. If not set, automatic mode is used.

Meeting any of these conditions triggers an alert.

Can be null.

The HighGcActivityThresholds object

Custom thresholds for high GC activity. If not set, automatic mode is used.

Meeting any of these conditions triggers an alert.

ElementTypeDescription
gcTimePercentageinteger

GC time is higher than X% in 3 out of 5 samples.

gcSuspensionPercentageinteger

GC suspension is higher than X% in 3 out of 5 samples.

The OutOfMemoryDetectionConfig object

Configuration of Java out of memory problems detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsOutOfMemoryThresholds

Custom thresholds for Java out of memory. If not set, automatic mode is used.

Can be null.

The OutOfMemoryThresholds object

Custom thresholds for Java out of memory. If not set, automatic mode is used.

ElementTypeDescription
outOfMemoryExceptionsNumberinteger

Alert if the number of Java out of memory exceptions is X per minute or higher.

The OutOfThreadsDetectionConfig object

Configuration of Java out of threads problems detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsOutOfThreadsThresholds

Custom thresholds for Java out of threads detection. If not set, automatic mode is used.

Can be null.

The OutOfThreadsThresholds object

Custom thresholds for Java out of threads detection. If not set, automatic mode is used.

ElementTypeDescription
outOfThreadsExceptionsNumberinteger

Alert if the number of Java out of threads exceptions is X per minute or higher.

The NetworkDroppedPacketsDetectionConfig object

Configuration of high number of dropped packets detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsNetworkDroppedPacketsThresholds

Custom thresholds for dropped packets. If not set, automatic mode is used.

All of these conditions must be met to trigger an alert.

Can be null.

The NetworkDroppedPacketsThresholds object

Custom thresholds for dropped packets. If not set, automatic mode is used.

All of these conditions must be met to trigger an alert.

ElementTypeDescription
droppedPacketsPercentageinteger

Receive/transmit dropped packet percentage is higher than X% in 3 out of 5 samples.

totalPacketsRateinteger

Total receive/transmit packets rate is higher than X packets per second in 3 out of 5 samples.

The NetworkErrorsDetectionConfig object

Configuration of high number of network errors detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsNetworkErrorsThresholds

Custom thresholds for network errors. If not set, automatic mode is used.

All of these conditions must be met to trigger an alert.

Can be null.

The NetworkErrorsThresholds object

Custom thresholds for network errors. If not set, automatic mode is used.

All of these conditions must be met to trigger an alert.

ElementTypeDescription
errorsPercentageinteger

Receive/transmit error packet percentage is higher than X% in 3 out of 5 samples.

totalPacketsRateinteger

Total receive/transmit packets rate is higher than X packets per second in 3 out of 5 samples.

The HighNetworkDetectionConfig object

Configuration of high network utilization detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsHighNetworkThresholds

Custom thresholds for high network utilization. If not set, automatic mode is used.

Can be null.

The HighNetworkThresholds object

Custom thresholds for high network utilization. If not set, automatic mode is used.

ElementTypeDescription
utilizationPercentageinteger

Alert if sent/received traffic utilization is higher than X% in 3 out of 5 samples.

The NetworkTcpProblemsDetectionConfig object

Configuration of TCP connectivity problems detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsNetworkTcpProblemsThresholds

Custom thresholds for TCP connection problems. If not set, automatic mode is used.

All of these conditions must be met to trigger an alert.

Can be null.

The NetworkTcpProblemsThresholds object

Custom thresholds for TCP connection problems. If not set, automatic mode is used.

All of these conditions must be met to trigger an alert.

ElementTypeDescription
newConnectionFailuresPercentageinteger

Percentage of new connection failures is higher than X% in 3 out of 5 samples.

failedConnectionsNumberPerMinuteinteger

Number of failed connections is higher than X connections per minute in 3 out of 5 samples.

The NetworkHighRetransmissionDetectionConfig object

Configuration of high retransmission rate detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsNetworkHighRetransmissionThresholds

Custom thresholds for high retransmission rate. If not set, automatic mode is used.

All of these conditions must be met to trigger an alert.

Can be null.

The NetworkHighRetransmissionThresholds object

Custom thresholds for high retransmission rate. If not set, automatic mode is used.

All of these conditions must be met to trigger an alert.

ElementTypeDescription
retransmissionRatePercentageinteger

Retransmission rate is higher than X% in 3 out of 5 samples.

retransmittedPacketsNumberPerMinuteinteger

Number of retransmitted packets is higher than X packets per minute in 3 out of 5 samples.

The DiskLowSpaceDetectionConfig object

Configuration of low disk space detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsDiskLowSpaceThresholds

Custom thresholds for low disk space. If not set, automatic mode is used.

Can be null.

The DiskLowSpaceThresholds object

Custom thresholds for low disk space. If not set, automatic mode is used.

ElementTypeDescription
freeSpacePercentageinteger

Alert if free disk space is lower than X% in 3 out of 5 samples.

The DiskSlowWritesAndReadsDetectionConfig object

Configuration of slow running disks detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsDiskSlowWriteAndReadsThresholds

Custom thresholds for slow running disks. If not set, the automatic mode is used.

Can be null.

The DiskSlowWriteAndReadsThresholds object

Custom thresholds for slow running disks. If not set, the automatic mode is used.

ElementTypeDescription
writeAndReadTimeinteger

Alert if disk read/write time is higher than X milliseconds in 3 out of 5 samples.

The DiskLowInodesDetectionConfig object

Configuration of low disk inodes number detection.

ElementTypeDescription
enabledboolean

The detection is enabled (true) or disabled (false).

customThresholdsDiskLowInodesThresholds

Custom thresholds for low disk inodes number. If not set, automatic mode is used.

Can be null.

The DiskLowInodesThresholds object

Custom thresholds for low disk inodes number. If not set, automatic mode is used.

ElementTypeDescription
freeInodesPercentageinteger

Alert if percentage of available inodes is lower than X% in 3 out of 5 samples.

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

json
{ "metadata": { "configurationVersions": [ 4, 2 ], "clusterVersion": "Mock version" }, "connectionLostDetection": { "enabled": true, "enabledOnGracefulShutdowns": true }, "highCpuSaturationDetection": { "enabled": true, "customThresholds": { "cpuSaturation": 90 } }, "highMemoryDetection": { "enabled": true, "customThresholds": { "pageFaultsPerSecondWindows": 50, "usedMemoryPercentageWindows": 85, "pageFaultsPerSecondNonWindows": 10, "usedMemoryPercentageNonWindows": 85 } }, "highGcActivityDetection": { "enabled": true, "customThresholds": { "gcTimePercentage": 35, "gcSuspensionPercentage": 20 } }, "outOfMemoryDetection": { "enabled": true, "customThresholds": { "outOfMemoryExceptionsNumber": 2 } }, "outOfThreadsDetection": { "enabled": true, "customThresholds": { "outOfThreadsExceptionsNumber": 2 } }, "networkDroppedPacketsDetection": { "enabled": true, "customThresholds": { "droppedPacketsPercentage": 8, "totalPacketsRate": 8 } }, "networkErrorsDetection": { "enabled": true, "customThresholds": { "errorsPercentage": 9, "totalPacketsRate": 9 } }, "highNetworkDetection": { "enabled": true, "customThresholds": { "utilizationPercentage": 88 } }, "networkTcpProblemsDetection": { "enabled": true, "customThresholds": { "newConnectionFailuresPercentage": 5, "failedConnectionsNumberPerMinute": 5 } }, "networkHighRetransmissionDetection": { "enabled": true, "customThresholds": { "retransmissionRatePercentage": 15, "retransmittedPacketsNumberPerMinute": 15 } }, "diskLowSpaceDetection": { "enabled": true, "customThresholds": { "freeSpacePercentage": 10 } }, "diskSlowWritesAndReadsDetection": { "enabled": true, "customThresholds": { "writeAndReadTime": 300 } }, "diskLowInodesDetection": { "enabled": true, "customThresholds": { "freeInodesPercentage": 10 } } }

Response

Response codes

CodeTypeDescription
204-

Success. Configuration has been updated. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid

Validate payload

We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.

The request consumes an application/json payload.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/hosts/validator
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/hosts/validator
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/hosts/validator

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Response

Response codes

CodeTypeDescription
204-

Validated. The submitted configuration is valid. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid

Example

In this example, the request updates the configuration of anomaly detection for database services from the GET request example. It activates the Alert on graceful host shutdowns feature. It also changes Detect CPU saturation on host mode to based on custom settings and sets the following threshold:

  • Alert if CPU usage is higher than 90% in 3 out of 5 samples.

The API token is passed in the Authorization header.

You can download or copy the example request body to try it out on your own. First, be sure to create a backup copy of your current configuration with the GET host anomaly detection configuration call.

Curl

shell
curl -X PUT \ https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/hosts \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \ -H 'Content-Type: application/json' \ -d '{<truncated - see the Request body section below>}'

Request URL

plaintext
https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/hosts

Request body

json
{ "connectionLostDetection": { "enabled": true, "enabledOnGracefulShutdowns": true }, "highCpuSaturationDetection": { "enabled": true, "customThresholds": { "cpuSaturation": 90 } }, "highMemoryDetection": { "enabled": true }, "highGcActivityDetection": { "enabled": true }, "outOfMemoryDetection": { "enabled": true }, "outOfThreadsDetection": { "enabled": true }, "networkDroppedPacketsDetection": { "enabled": true }, "networkErrorsDetection": { "enabled": true }, "highNetworkDetection": { "enabled": true }, "networkTcpProblemsDetection": { "enabled": true }, "networkHighRetransmissionDetection": { "enabled": true }, "diskLowSpaceDetection": { "enabled": true }, "diskSlowWritesAndReadsDetection": { "enabled": true }, "diskLowInodesDetection": { "enabled": true } }

Response code

204

Result

The updated configuration has the following parameters:

Anomaly detection config - hosts - updated

Related topics
  • Adjust the sensitivity of anomaly detection for infrastructure

    Adjust problem detection sensitivity for infrastructure.

  • Problem detection and analysis

    Understand the basic concepts related to how Dynatrace detects and raises alerts for problems detected in your environment.