Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

Alerts

Overview

The alerts resource allows you to retrieve alerts by their status, alert ID, or alert configuration and to acknowledge alerts.

When Ops Manager detects an alert condition, it opens an alert. If the alert configuration contains no notification delay, the alert status goes immediately to OPEN. If the configuration contains a delay, Ops Manager sets the alert to TRACKING until the delay period ends, after which Ops Manager sets the alert to OPEN if the condition persists.

If an alert configuration has multiple notifications, each with its own notification delay, Ops Manager uses the smallest delay value to determine when to move an alert from TRACKING to OPEN. An alert configuration sets notification delay in the delayMin field in the notification array.

Endpoints

Get All Alerts

Gets all alerts regardless of status.

GET /api/public/v1.0/groups/GROUP-ID/alerts

Use the status query parameter with one of these possible values: TRACKING, OPEN, or CLOSED to get all alerts with the specified status.

GET /api/public/v1.0/groups/GROUP-ID/alerts?status=STATUS

Get an Alert

Gets a single alert by ID.

GET /api/public/v1.0/groups/GROUP-ID/alerts/ALERT-ID

Get Alert Configurations that Triggered an Alert

Gets the alert configuration(s) that triggered the specified alert.

GET /api/public/v1.0/groups/GROUP-ID/alerts/ALERT-ID/alertConfigs

Acknowledge an Alert

Updates an existing alert. The only field you may modify is the acknowledgedUntil field.

PATCH /api/public/v1.0/groups/GROUP-ID/alerts/ALERT-ID

To acknowledge an alert “forever”, set the date to 100 years in the future.

To unacknowledge a previously acknowledged alert, set the date in the past.

Sample Entity

The fields in the return document depend on the alert type. The typeName field specifies the alert type. The fields shown here are common to all alert types.

{
  "id": "yyy",
  "groupId": "xxx",
  "alertConfigId": "xxx",
  "typeName": "HOST_METRIC",
  "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
  "status": "OPEN",
  "acknowledgedUntil": "2014-03-01T12:00:00Z",
  "created": "2014-02-01T12:34:12Z",
  "updated": "2014-02-02T01:23:45Z",
  "resolved": null,
  "lastNotified": "2014-02-04T02:43:13Z",

  // Additional fields follow, depending on the type of alert

  "links": [ ... ]
}

Entity Fields

Name Type Description
id string Unique identifier.
groupId string ID of the group that this alert was opened for.
alertConfigId string ID of the alert configuration that triggered this alert.
typeName string

The type of alert. Possible values are:

  • HOST
  • HOST_METRIC
  • AGENT
  • BACKUP
  • GROUP
  • REPLICA_SET
  • USER
eventTypeName string

The name of the event that triggered the alert. The possible values here depend on the typeName:

  • HOST alert type. Possible values:
    • HOST_DOWN
    • HOST_RECOVERING
    • VERSION_BEHIND
    • HOST_EXPOSED
  • HOST_METRIC alert type. Possible value:
    • OUTSIDE_METRIC_THRESHOLD
  • AGENT alert type. Possible values:
    • MONITORING_AGENT_DOWN
    • MONITORING_AGENT_VERSION_BEHIND
    • BACKUP_AGENT_DOWN
    • BACKUP_AGENT_VERSION_BEHIND
    • BACKUP_AGENT_CONF_CALL_FAILURE
  • BACKUP alert type. Possible values:
    • OPLOG_BEHIND
    • CLUSTER_MONGOS_IS_MISSING
    • RESYNC_REQUIRED
    • RS_BIND_ERROR
    • BACKUP_TOO_MANY_RETRIES
    • BACKUP_IN_UNEXPECTED_STATE
    • LATE_SNAPSHOT
    • BAD_CLUSTERSHOTS
    • SYNC_SLICE_HAS_NOT_PROGRESSED
  • GROUP alert type. Possible values:
    • USERS_AWAITING_APPROVAL
    • USERS_WITHOUT_MULTI_FACTOR_AUTH
  • REPLICA_SET alert type. Possible values:
    • CONFIGURATION_CHANGED
    • PRIMARY_ELECTED
    • TOO_FEW_HEALTHY_MEMBERS
    • TOO_MANY_UNHEALTHY_MEMBERS
    • NO_PRIMARY
  • USER alert type. Possible values:``
    • JOINED_GROUP
    • REMOVED_FROM_GROUP
status string

The current state of the alert. Possible values are:

  • TRACKING
  • OPEN
  • CLOSED
acknowledgedUntil date The date through which the alert has been acknowledged. Will not be present if the alert has never been acknowledged.
acknowledgementComment string The comment left by the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
acknowledgingUsername string The username of the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
created date When the alert was opened.
updated date When the alert was last updated.
resolved date When the alert was closed. Only present if the status is CLOSED.
lastNotified date When the last notification was sent for this alert. Only present if notifications have been sent.
hostnameAndPort string The hostname and port of each host to which the alert applies. Only present for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
hostId string ID of the host to which the metric pertains. Only present for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
replicaSetName string Name of the replica set. Only present for alerts of type HOST, HOST_METRIC, BACKUP, and REPLICA_SET.
metricName string

The name of the metric whose value went outside the threshold. Only present for alerts of type HOST_METRIC. Possible values are:

  • ASSERT_MSG
  • ASSERT_REGULAR
  • ASSERT_USER
  • ASSERT_WARNING
  • BACKGROUND_FLUSH_AVG
  • CACHE_BYTES_READ_INTO
  • CACHE_BYTES_WRITTEN_FROM
  • CACHE_DIRTY_BYTES
  • CACHE_USED_BYTES
  • COMPUTED_MEMORY
  • CONNECTIONS
  • CURSORS_TOTAL_CLIENT_CURSORS_SIZE
  • CURSORS_TOTAL_OPEN
  • CURSORS_TOTAL_TIMED_OUT
  • DB_STORAGE_TOTAL
  • EXTRA_INFO_PAGE_FAULTS
  • GLOBAL_LOCK_CURRENT_QUEUE_READERS
  • GLOBAL_LOCK_CURRENT_QUEUE_TOTAL
  • GLOBAL_LOCK_CURRENT_QUEUE_WRITERS
  • GLOBAL_LOCK_PERCENTAGE
  • INDEX_COUNTERS_BTREE_ACCESSES
  • INDEX_COUNTERS_BTREE_HITS
  • INDEX_COUNTERS_BTREE_MISS_RATIO
  • INDEX_COUNTERS_BTREE_MISSES
  • JOURNALING_COMMITS_IN_WRITE_LOCK
  • JOURNALING_MB
  • JOURNALING_WRITE_DATA_FILES_MB
  • MEMORY_RESIDENT
  • MEMORY_VIRTUAL
  • MEMORY_MAPPED
  • NETWORK_BYTES_IN
  • NETWORK_BYTES_OUT
  • NETWORK_NUM_REQUESTS
  • OPCOUNTER_CMD
  • OPCOUNTER_DELETE
  • OPCOUNTER_INSERT
  • OPCOUNTER_QUERY
  • OPCOUNTER_REPL_UPDATE
  • OPCOUNTER_REPL_DELETE
  • OPCOUNTER_REPL_INSERT
  • OPCOUNTER_UPDATE
  • OPLOG_MASTER_LAG_TIME_DIFF
  • OPLOG_MASTER_TIME
  • OPLOG_SLAVE_LAG_MASTER_TIME
  • TICKETS_AVAILABLE_READS
  • TICKETS_AVAILABLE_WRITES
currentValue object The current value of the metric that triggered the alert. Only present for alerts of type HOST_METRIC.
currentValue.number number The value of the metric.
currentValue.units string

The units for the value. Depends on the type of metric. For example, a metric that measures memory consumption would have a byte measurement, while a metric that measures time would have a time unit. Possible values are:

  • RAW
  • BITS
  • BYTES
  • KILOBITS
  • KILOBYTES
  • MEGABITS
  • MEGABYTES
  • GIGABITS
  • GIGABYTES
  • TERABYTES
  • PETABYTES
  • MILLISECONDS
  • SECONDS
  • MINUTES
  • HOURS
  • DAYS
clusterId string The ID of the cluster to which this alert applies. Only present for alerts of type BACKUP and REPLICA_SET.
clusterName string The name the cluster to which this alert applies. Only present for alerts of type BACKUP and REPLICA_SET.
sourceTypeName string

For alerts of the type BACKUP, the type of server being backed up. Possible values are:

  • REPLICA_SET
  • SHARDED_CLUSTER
  • CONFIG_SERVER

Examples

Get an Alert

curl -u "username:apiKey" --digest -i "https://cloud.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/alerts/533cb4b8e4b0f1820cdabc7f"

HTTP/1.1 200 OK

{
  "id" : "533cb4b8e4b0f1820cdabc7f",
  "groupId" : "5196d3628d022db4cbc26d9e",
  "typeName" : "BACKUP",
  "eventTypeName" : "OPLOG_BEHIND",
  "status" : "CLOSED",
  "created" : "2014-04-03T01:09:12Z",
  "updated" : "2014-04-03T01:14:12Z",
  "resolved" : "2014-04-03T01:14:12Z",
  "links" : [ ... ]
}

Get All Open Alerts

curl -u "username:apiKey" --digest -i "https://cloud.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/alerts?status=OPEN"

HTTP/1.1 200 OK

{
  "totalCount": 1,
  "results": [ {
    "alertConfigId":"55e756a6e4b0fa1210c695a2",
    "id" : "533dc45ee4b00835ff81ec2a",
    "groupId" : "5196d3628d022db4cbc26d9e",
    "hostId":"51714c7fa22cbe473a9573d3629ff53c",
    "hostnameAndPort":"example.test.4182.mongodbdns.com:27017",
    "typeName" : "HOST_METRIC",
    "eventTypeName" : "OUTSIDE_METRIC_THRESHOLD",
    "status" : "OPEN",
    "created" : "2014-04-03T20:28:14Z",
    "updated" : "2014-04-03T20:28:14Z",
    "lastNotified" : "2014-04-03T20:28:23Z",
    "metricName": "ASSERTS_REGULAR",
    "currentValue" : {
      "number" : 0.0,
      "units" : "RAW"
    },
    "links" : [ ... ]
  } ],
  "links" : [ ... ]
}

Get Alert Configurations that Triggered an Alert

curl -u "username:apiKey" --digest -i "https://cloud.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/alerts/533cb4b8e4b0f1820cdabc7f/alertConfigs"

HTTP/1.1 200 OK

{
  "totalCount": 3,
  "results": [ {
    "id" : "5271259ee4b00ece6b4754ef",
    "groupId" : "5196d3628d022db4cbc26d9e",
    "typeName" : "BACKUP",
    "eventTypeName" : "RESYNC_REQUIRED",
    "created" : "2013-10-30T15:28:30Z",
    "updated" : "2014-02-12T16:11:05Z",
    "enabled" : true,
    "matchers" : [ ],
    "notifications" : [ {
      "typeName" : "EMAIL",
      "intervalMin" : 60,
      "delayMin" : 0,
      "emailAddress" : "somebody@example.com"
    } ],
    "links" : [ ... ]
  } ],
  "links" : [ ... ]
}

Acknowledge an Alert

curl -u "username:apiKey" -H "Content-Type: application/json" --digest -i -X PATCH "https://cloud.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/alerts/533dc45ee4b00835ff81ec2a" --data '
{
  "acknowledgedUntil": "2014-04-15T00:00:00-0400",
  "acknowledgementComment": "This is normal. Please ignore."
}'

HTTP/1.1 200 OK

{
  "id" : "533dc45ee4b00835ff81ec2a",
  "groupId" : "5196d3628d022db4cbc26d9e",
  "typeName" : "HOST_METRIC",
  "eventTypeName" : "OUTSIDE_METRIC_THRESHOLD",
  "status" : "OPEN",
  "acknowledgedUntil" : "2014-04-15T04:00:00Z",
  "acknowledgementComment" : "This is normal. Please ignore.",
  "acknowledgingUsername" : "someuser@example.com",
  "created" : "2014-04-03T20:28:14Z",
  "updated" : "2014-04-03T20:33:14Z",
  "lastNotified" : "2014-04-03T20:33:23Z",
  "metricName": "ASSERTS_REGULAR",
  "currentValue" : {
    "number" : 0.0,
    "units" : "RAW"
  },
  "links" : [ ... ]
}