- API >
- Public API Resources >
- Alerts
Alerts¶
On this page
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.
Use the status
query parameter with one of these possible values:
TRACKING
, OPEN
, or CLOSED
to get all alerts with the
specified status.
Get an Alert¶
Gets a single alert by ID.
Get Alert Configurations that Triggered an Alert¶
Gets the alert configuration(s) that triggered the specified alert.
Acknowledge an Alert¶
Updates an existing alert. The only field you may modify is the
acknowledgedUntil
field.
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.
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:
|
eventTypeName |
string | The name of the event that triggered the alert. The possible values here
depend on the
|
status |
string | The current state of the alert. Possible values are:
|
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
|
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:
|
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
|
Links¶
Relation |
Description |
---|---|
self |
Me |
http://mms.mongodb.com/group |
The group that this alert was triggered for. |
http://mms.mongodb.com/alertConfig |
The alert configuration that triggered this alert. |
http://mms.mongodb.com/alertConfigs |
A list of alert configurations that triggered this alert. This list will
only contain a single element and is present for backward compatibility.
New code should use the alertConfig link instead. |
http://mms.mongodb.com/host |
The host that triggered this alert. Only present for alerts of type
HOST or REPLICA_SET . |
http://mms.mongodb.com/cluster |
The replica set or sharded cluster that triggered this alert. Only
present for alerts of type REPLICA_SET or BACKUP . |