monitoring_alert_policy

Synopsis

Requirements

  • pydo >= 0.1.3
  • azure-core >= 1.26.1

Parameters

Parameter Choices Default Comments
alerts
(dict)
Alert object.
client_override_options
(dict)
Client override options (developer use). For example, can be used to override the DigitalOcean API endpoint for an internal test suite. If provided, these options will knock out existing options.
compare
(str)
  • GreaterThan
  • LessThan
Comparision.
description
(str)
Description.
enabled
(bool)
Enabled.
entities
(list)
Entities.
module_override_options
(dict)
Module override options (developer use). Can be used to override module options to support experimental or future options. If provided, these options will knock out existing options.
state
(str)
  • present
  • absent
present State of the resource, present to create, absent to destroy.
tags
(list)
Tags.
timeout
(int)
300 Polling timeout in seconds.
token
(str)
DigitalOcean API token. There are several environment variables which can be used to provide this value. DIGITALOCEAN_ACCESS_TOKEN, DIGITALOCEAN_TOKEN, DO_API_TOKEN, DO_API_KEY, DO_OAUTH_TOKEN and OAUTH_TOKEN
type
(str)
  • v1/insights/droplet/load_1
  • v1/insights/droplet/load_5
  • v1/insights/droplet/load_15
  • v1/insights/droplet/memory_utilization_percent
  • v1/insights/droplet/disk_utilization_percent
  • v1/insights/droplet/cpu
  • v1/insights/droplet/disk_read
  • v1/insights/droplet/disk_write
  • v1/insights/droplet/public_outbound_bandwidth
  • v1/insights/droplet/public_inbound_bandwidth
  • v1/insights/droplet/private_outbound_bandwidth
  • v1/insights/droplet/private_inbound_bandwidth
  • v1/insights/lbaas/avg_cpu_utilization_percent
  • v1/insights/lbaas/connection_utilization_percent
  • v1/insights/lbaas/droplet_health
  • v1/insights/lbaas/tls_connections_per_second_utilization_percent
  • v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx
  • v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx
  • v1/insights/lbaas/increase_in_http_error_rate_count_5xx
  • v1/insights/lbaas/increase_in_http_error_rate_count_4xx
  • v1/insights/lbaas/high_http_request_response_time
  • v1/insights/lbaas/high_http_request_response_time_50p
  • v1/insights/lbaas/high_http_request_response_time_95p
  • v1/insights/lbaas/high_http_request_response_time_99p
  • v1/dbaas/alerts/load_15_alerts
  • v1/dbaas/alerts/memory_utilization_alerts
  • v1/dbaas/alerts/disk_utilization_alerts
  • v1/dbaas/alerts/cpu_alerts
Type.
value
(float)
Value.
window
(str)
  • 5m
  • 10m
  • 30m
  • 1h
Window.

Examples

- name: Create monitoring alert policy
  digitalocean.cloud.monitoring_alert_policy:
    token: "{{ token }}"
    state: present
    alerts:
      email:
        - [email protected]
      slack:
        - channel: Production Alerts
          url: https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ
    compare: GreaterThan
    description: CPU Alert
    enabled: true
    entities:
      - 192018292
    tags:
      - droplet_tag
    type: v1/insights/droplet/cpu
    value: 80
    window: 5m

Return Values

Key Returned Description
alerts
(dict)
always Monitoring alert policy information.

Sample:

{
  "alerts": {
    "email": [
      "[email protected]"
    ],
    "slack": [
      {
        "channel": "Production Alerts",
        "url": "https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ"
      }
    ]
  },
  "compare": "GreaterThan",
  "description": "CPU Alert",
  "enabled": true,
  "entities": [
    "192018292"
  ],
  "tags": [
    "droplet_tag"
  ],
  "type": "v1/insights/droplet/cpu",
  "value": 80,
  "window": "5m"
}
error
(dict)
failure DigitalOcean API error.

Sample:

{
  "Message": "Informational error message.",
  "Reason": "Unauthorized",
  "Status Code": 401
}
msg
(str)
always Monitoring alert policy result information.

Sample:

[
  "Created redis database cluster backend (9cc10173-e9ea-4176-9dbc-a4cee4c4ff30) in nyc3",
  "Deleted redis database cluster backend (9cc10173-e9ea-4176-9dbc-a4cee4c4ff30) in nyc3",
  "redis database cluster backend in nyc3 would be created",
  "redis database cluster backend (9cc10173-e9ea-4176-9dbc-a4cee4c4ff30) in nyc3 exists",
  "redis database cluster backend in nyc3 does not exist",
  "redis database cluster backend (9cc10173-e9ea-4176-9dbc-a4cee4c4ff30) would be deleted"
]
In this article...