Navigation

Get All Project Events

Limited to Project Read Only Role

Only users with the Project Read Only can request this endpoint.

Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0

Resource

GET /groups/{GROUP-ID}/events

Request Path Parameters

This endpoint does not use HTTP request path parameters.

Request Query Parameters

Unique Query Parameters

This endpoint accepts the following query parameters to filter returned events:

Name Type Description Default
minDate string Return only events for which the created date is greater than or equal to the specified Timestamp in ISO 8601 date and time format in UTC.  
maxDate string Return only events for which the created date is less than or equal to the specified Timestamp in ISO 8601 date and time format in UTC.  
eventType string

Return only events of the specified types. Accepted values include:

  • Host alerts support these values:
    • HOST_DOWN
    • HOST_RECOVERING
    • VERSION_BEHIND
    • HOST_EXPOSED
    • OUTSIDE_METRIC_THRESHOLD
  • Agent alerts support these values:
    • MONITORING_AGENT_DOWN
    • MONITORING_AGENT_VERSION_BEHIND
    • BACKUP_AGENT_DOWN
    • BACKUP_AGENT_VERSION_BEHIND
    • BACKUP_AGENT_CONF_CALL_FAILURE
  • Backup alerts support these values:
    • OPLOG_BEHIND
    • CLUSTER_MONGOS_IS_MISSING
    • RESYNC_REQUIRED
    • BAD_CLUSTERSHOTS
    • RS_BIND_ERROR (x alerts only)
    • BACKUP_TOO_MANY_RETRIES (global alerts only)
    • BACKUP_IN_UNEXPECTED_STATE (global alerts only)
    • LATE_SNAPSHOT (global alerts only)
    • SYNC_SLICE_HAS_NOT_PROGRESSED (global alerts only)
    • BACKUP_JOB_TOO_BUSY (global alerts only)
    • GROUP_TAGS_CHANGED (global alerts only)
  • Project alerts support these values:
    • USERS_AWAITING_APPROVAL
    • USERS_WITHOUT_MULTI_FACTOR_AUTH
  • Replica set alerts support these values:
    • CONFIGURATION_CHANGED
    • PRIMARY_ELECTED
    • TOO_FEW_HEALTHY_MEMBERS
    • TOO_MANY_UNHEALTHY_MEMBERS
    • NO_PRIMARY
  • Sharded cluster alerts support this value:
    • CLUSTER_MONGOS_IS_MISSING
  • User alerts support these values:
    • JOINED_GROUP
    • REMOVED_FROM_GROUP
 

Common Query Parameters

This endpoint also accepts the query parameters common to all endpoints that return lists of values:

Name Type Description Default
pageNum integer Page number (1-based). 1
itemsPerPage integer Maximum number of items to return, up to a maximum of 100. 100
pretty boolean Indicates whether the response body should be in a prettyprint format. false
envelope boolean

Indicates whether or not to wrap the response in an envelope.

Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

For endpoints that return one result, response body includes:

status HTTP response code
envelope The expected response body

For endpoints that return a list of results, the results object is an envelope. Ops Manager adds the status field to the response body.

 

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response

Response Document

The response JSON document includes an array of result objects, an array of link objects and a count of the total number of result objects retrieved.

Name Type Description
results object array This array includes one object for each item detailed in the results Embedded Document section.
links object array This array includes one or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
totalCount number The count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.

results Embedded Document

Each result is one alert.

Name Type Description
alertId string Unique identifier for the alert associated with this event.
alertConfigId string Unique identifier for the alert configuration associated with the alertId.
clusterId string ID of the cluster to which this event applies.
clusterName string Name of the cluster to which this event applies.
created string Timestamp in ISO 8601 date and time format in UTC when this event was triggered.
currentValue object Current value of the metric that triggered this event.
currentValue.number number Value of the metric.
currentValue.units string

Relevant units for the value.

Example

A metric that measures memory consumption would have a byte measurement, while a metric that measures time would have a time unit.

Accepted values are:

  • RAW
  • BITS
  • BYTES
  • KILOBITS
  • KILOBYTES
  • MEGABITS
  • MEGABYTES
  • GIGABITS
  • GIGABYTES
  • TERABYTES
  • PETABYTES
  • MILLISECONDS
  • SECONDS
  • MINUTES
  • HOURS
  • DAYS
eventTypeName string

Name of the circumstance that triggered this event. Accepted values are:

  • Host alerts support these values:
    • HOST_DOWN
    • HOST_RECOVERING
    • VERSION_BEHIND
    • HOST_EXPOSED
    • OUTSIDE_METRIC_THRESHOLD
  • Agent alerts support these values:
    • MONITORING_AGENT_DOWN
    • MONITORING_AGENT_VERSION_BEHIND
    • BACKUP_AGENT_DOWN
    • BACKUP_AGENT_VERSION_BEHIND
    • BACKUP_AGENT_CONF_CALL_FAILURE
  • Backup alerts support these values:
    • OPLOG_BEHIND
    • CLUSTER_MONGOS_IS_MISSING
    • RESYNC_REQUIRED
    • BAD_CLUSTERSHOTS
    • RS_BIND_ERROR (x alerts only)
    • BACKUP_TOO_MANY_RETRIES (global alerts only)
    • BACKUP_IN_UNEXPECTED_STATE (global alerts only)
    • LATE_SNAPSHOT (global alerts only)
    • SYNC_SLICE_HAS_NOT_PROGRESSED (global alerts only)
    • BACKUP_JOB_TOO_BUSY (global alerts only)
    • GROUP_TAGS_CHANGED (global alerts only)
  • Project alerts support these values:
    • USERS_AWAITING_APPROVAL
    • USERS_WITHOUT_MULTI_FACTOR_AUTH
  • Replica set alerts support these values:
    • CONFIGURATION_CHANGED
    • PRIMARY_ELECTED
    • TOO_FEW_HEALTHY_MEMBERS
    • TOO_MANY_UNHEALTHY_MEMBERS
    • NO_PRIMARY
  • Sharded cluster alerts support this value:
    • CLUSTER_MONGOS_IS_MISSING
  • User alerts support these values:
    • JOINED_GROUP
    • REMOVED_FROM_GROUP
groupId string ID of the project in which this event occurred.
hostId string ID of the host on which this event occurred.
hostname string Hostname of the host on which this event occurred.
id string Unique identifier for this event.
isGlobalAdmin boolean Flag indicating whether the user who triggered this event has the Global Monitoring Administrator role.
links object array One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification
metricName string

Name of the measurement whose value went outside the threshold.

For possible values, see below.

port integer Port of the host associated with this event.
remoteAddress string IP address associated with the Ops Manager user (userId) who triggered the event.
replicaSetName string Name of the replica set.
shardName string The name of the shard associated with the event.
targetUsername string Username for the Ops Manager user targeted by this event.
teamId string Unique identifier for the Ops Manager team associated with this event.
userId string Unique identifier for the Ops Manager user who triggered this event.
username string Username for the Ops Manager user who triggered this event.

Example Request

curl --user "{USERNAME}:{APIKEY}" --digest \
 --header "Accept: application/json" \
 --header "Content-Type: application/json" \
 --include \
 --request GET "https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0/groups/{GROUP-ID}/events?pretty=true"

Example Response

Response Header

HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}

Response Body

{
  "alertConfigId": "{ALERT-CONFIG-ID}",
  "alertId": "{ALERT-ID}",
  "clusterId": "{CLUSTER-ID}",
  "clusterName": "Test Cluster",
  "created": "2018-06-11T12:34:56Z",
  "currentValue": {
    "number": 50,
    "units": "RAW"
  },
  "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
  "groupId": "{PROJECT-ID}",
  "hostId": "{HOST-ID}",
  "hostname": "db.example.com",
  "id": "{GLOBAL-ALERT-ID}",
  "isGlobalAdmin": false,
  "maintenanceWindowId": "{MAINTENANCE-WINDOW-ID}",
  "metricName": "OPCOUNTER_CMD",
  "orgId": "{ORG-ID}",
  "port": 27017,
  "remoteAddress": "192.168.1.1",
  "replicaSetName": "rs1",
  "shardName": "sh1",
  "userId": "{USER-ID}",
  "username": "john.doe@example.com",
  "targetUsername": "jane.doe@example.com",
  "teamId": "{TEAM-ID}"
}