OpsGenie

ENTERPRISE: Built-in integrations are available for Sensu Enterprise users only.

Overview

Create and close OpsGenie alerts for events.

NOTE: As of Sensu Enterprise 3.0, the OpsGenie integration uses version 2 of the OpsGenie API. Visit the Sensu Enterprise 3.0 upgrade guide and the OpsGenie API docs for more information.

Configuration

Example(s)

The following is an example global configuration for the opsgenie enterprise event handler (integration).

{
  "opsgenie": {
    "api_key": "eed02a0d-85a4-427b-851a-18dd8fd80d93",
    "source": "Sensu Enterprise (AWS)",
    "responders":[
      {
        "name":"afterhours",
        "type":"schedule"
      }
    ],
    "visible_to":[
      {
        "name":"ops",
        "type":"team"
      }
    ],
    "actions": ["ShowProcesses"],
    "tags": ["production"],
    "overwrite_quiet_hours": true,
    "timeout": 10
  }
}

Integration Specification

opsgenie attributes

The following attributes are configured within the {"opsgenie": {} } configuration scope.

NOTE: Some attributes are only available for certain OpsGenie subscription tiers.

api_endpoint
description The OpsGenie Alert API endpoint to use when connecting to OpsGenie: api.opsgenie.com for the US service region or api.eu.opsgenie.com for the European service region.
required false
default api.opsgenie.com (US service region)
type String
example
"api_endpoint": "api.eu.opsgenie.com"
api_key
description The OpsGenie Alert API key to use when creating/closing alerts.
required true
type String
example
"api_key": "eed02a0d-85a4-427b-851a-18dd8fd80d93"
source
description The source to use for OpsGenie alerts.
required false
type String
default Sensu Enterprise
example
"source": "Sensu (us-west-1)"
responders
description The OpsGenie teams, users, schedules, or escalations that receive alert notifications. Each responder requires an id or name and a type (team, user, escalation, or schedule). NOTE: For "type":"user", use username instead of name.
required false
type Array of objects
example
"responders":[
  {
    "name":"afterhours",
    "type":"schedule"
  },
  {
    "id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8",
    "type":"user"
  },
  {
    "username":"alice@company.com",
    "type":"user"
  },
  {
    "id":"aee8a0de-c80f-4515-a232-501c0bc9d715",
    "type":"escalation"
  }
]
visible_to
description The OpsGenie teams and users that can see alerts but won’t receive notifications. Teams require an id or name and "type":"team". Users require an id or username and "type":"user".
required false
type Array of objects
example
"visible_to":[
  {
    "name":"ops",
    "type":"team"
  },
  {
    "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c",
    "type":"team"
  },
  {
    "id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8",
    "type":"user"
  },
  {
    "username":"alice@company.com",
    "type":"user"
  }
]
actions
description Custom actions available for the alert
required false
type Array
example
"actions": ["ViewLogs", "ShowProcesses"]
tags
description An array of OpsGenie alert tags that will be added to created alerts. PRO TIP: Augment the tags applied to each incident by specifying additional OpsGenie tags in check and client definitions. See the Sensu Core reference docs to configure OpsGenie check attributes and client attributes.
required false
type Array
default []
example
"tags": ["production"]
overwrite_quiet_hours
description When configured, critical severity events will be tagged with “OverwriteQuietHours”. This tag indicates that OpsGenie should bypass configured “quiet hours” that would otherwise filter alert notifications.
required false
type Boolean
default false
example
"overwrite_quiet_hours": true
filters
description An array of Sensu event filters (names) to use when filtering events for the handler. Each array item must be a string. Specified filters are merged with default values.
required false
type Array
default
["handle_when", "check_dependencies"]
example
"filters": ["recurrence", "production"]
severities
description An array of check result severities the handler will handle. NOTE: event resolution bypasses this filtering.
required false
type Array
allowed values ok, warning, critical, unknown
example
 "severities": ["critical", "unknown"]
timeout
description The handler execution duration timeout in seconds (hard stop).
required false
type Integer
default 10
example
"timeout": 30