Navigation

Alpha Release of MongoDB CLI

This is a pre-release early version of MongoDB CLI. Do not use MongoDB CLI to manage production environments.

mongocli cloud-manager alerts list

On this page

The alerts list command retrieves all alerts for the specified Cloud Manager project.

Syntax

mongocli cloud-manager|cm alert|alerts list|ls
     [ --limit <number-of-items-per-page> ]
     [ --page <page-number> ]
     [ --profile|-P <profile-name> ]
     [ --projectId <id-of-project> ]
     [ --status <alert-status> ]

Options

Option Type Description Required?
--limit integer Number of items per page, up to a maximum of 500. Defaults to 100 if not specified. no
--page integer Page number (1-based). Defaults to 1 if not specified. no
--profile, -P string Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI. no
--projectId string Unique identifier of the project that contains the alerts to retrieve. If omitted, uses the project ID in the profile or environment variable. no
--status string

Status of the alerts you want to return. The MongoDB CLI returns alerts that match the status you indicate. Accepted values include:

TRACKING Alert conditions exist, but the condition hasn’t persisted for long enough to trigger an alert.
OPEN Alert is open.
CLOSED Alert is closed.
no

Output

For each alert, the command prints the following fields in JSON format to the terminal if the command succeeds. If the command returns errors, see Troubleshooting for recommended solutions.

Name Type Description
id string Unique identifier for the alert.
groupId string ID of the project for which this alert was opened.
alertConfigId string ID of the alert configuration that triggered this alert.
eventTypeName string The name of the event that triggered the alert. The possible values depend on the alert type.
status string

The current state of the alert. Possible values are:

TRACKING Alert conditions exist, but the condition hasn’t persisted for long enough to trigger an alert.
OPEN Alert is open.
CLOSED Alert is closed.
CANCELLED Alert is cancelled.
created date Timestamp in ISO 8601 date and time format in UTC when this alert was created.
updated date Timestamp in ISO 8601 date and time format in UTC when this alert was last updated.
lastNotified date Timestamp in ISO 8601 date and time format in UTC when the last notification was sent for this alert. Only present if notifications have been sent.
resolved date Timestamp in ISO 8601 date and time format in UTC when the alert was closed. Only present if the status is CLOSED.
acknowledgedUntil date Timestamp in ISO 8601 date and time format in UTC through which the alert has been acknowledged. This is not present if the alert has never been acknowledged.
acknowledgementComment string The comment left by the user who acknowledged the alert. This is not present if the alert has never been acknowledged.
acknowledgingUsername string The username of the user who acknowledged the alert. This is not present if the alert has never been acknowledged.
hostnameAndPort string The hostname and port of the host to which the alert applies.
metricName string

The name of the metric whose value went outside the threshold. Only present if eventTypeName is OUTSIDE_METRIC_THRESHOLD. 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_DATA_SIZE_TOTAL
  • DB_STORAGE_TOTAL
  • DISK_PARTITION_SPACE_USED_DATA
  • DISK_PARTITION_SPACE_USED_INDEX
  • DISK_PARTITION_SPACE_USED_JOURNAL
  • DISK_PARTITION_UTILIZATION_DATA
  • DISK_PARTITION_UTILIZATION_INDEX
  • DISK_PARTITION_UTILIZATION_JOURNAL
  • EXTRA_INFO_PAGE_FAULTS
  • GLOBAL_ACCESSES_NOT_IN_MEMORY
  • GLOBAL_LOCK_CURRENT_QUEUE_READERS
  • GLOBAL_LOCK_CURRENT_QUEUE_TOTAL
  • GLOBAL_LOCK_CURRENT_QUEUE_WRITERS
  • GLOBAL_LOCK_PERCENTAGE
  • GLOBAL_PAGE_FAULT_EXCEPTIONS_THROWN
  • 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
  • LOGICAL_SIZE
  • MEMORY_RESIDENT
  • MEMORY_VIRTUAL
  • MEMORY_MAPPED
  • NETWORK_BYTES_IN
  • NETWORK_BYTES_OUT
  • NETWORK_NUM_REQUESTS
  • NORMALIZED_SYSTEM_CPU_USER
  • 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_RATE_GB_PER_HOUR
  • OPLOG_SLAVE_LAG_MASTER_TIME
  • RESTARTS_IN_LAST_HOUR
  • TICKETS_AVAILABLE_READS
  • TICKETS_AVAILABLE_WRITES
currentValue object The current value of the metric that triggered the alert. Only present if eventTypeName is OUTSIDE_METRIC_THRESHOLD.
currentValue.number float The value.
currentValue.units string

The units for the value. Possible units are:

  • RAW
  • BITS
  • BYTES
  • KILOBITS
  • KILOBYTES
  • MEGABITS
  • MEGABYTES
  • GIGABITS
  • GIGABYTES
  • TERABYTES
  • PETABYTES
  • MILLISECONDS
  • SECONDS
  • MINUTES
  • HOURS
  • DAYS
replicaSetName string Name of the replica set, if applicable.
clusterName string The name the cluster to which this alert applies.

Example

The following example uses the mongocli cm alerts list command to retrieve all alerts that occurred for the specified project. It uses the profile named myprofile for accessing Cloud Manager.

mongocli cm alerts list --projectId 5e84b94c003f2d6370004f4e \
--profile myprofile

The previous command prints the following fields in JSON format to the terminal. To learn more about these fields, see Output.

{
     "links": [
             {
                     "rel": "self",
                     "href": "https://cloud.mongodb.com/api/public/v1.0/groups/5e84b94c003f2d6370004f4e/alerts?pageNum=1\u0026itemsPerPage=100"
             }
     ],
     "results": [
             {
                     "id": "5eab6d6399da0e4c17d72ad1",
                     "groupId": "5e84b94c003f2d6370004f4e",
                     "alertConfigId": "5e84c02cb5289542e0c42bd2",
                     "eventTypeName": "OPLOG_BEHIND",
                     "created": "2020-05-01T00:29:23Z",
                     "updated": "2020-05-01T00:31:59Z",
                     "resolved": "2020-05-01T00:31:59Z",
                     "status": "CLOSED",
                     "lastNotified": "2020-05-01T00:32:08Z",
                     "replicaSetName": "cm-clstr-repl"
             },
             {
                     "id": "5eab7fae51bf8c14042072e0",
                     "groupId": "5e84b94c003f2d6370004f4e",
                     "alertConfigId": "5e84c02cb5289542e0c42bd2",
                     "eventTypeName": "OPLOG_BEHIND",
                     "created": "2020-05-01T01:47:26Z",
                     "updated": "2020-05-01T02:34:25Z",
                     "resolved": "2020-05-01T02:34:25Z",
                     "status": "CLOSED",
                     "lastNotified": "2020-05-01T02:34:34Z",
                     "replicaSetName": "cm-clstr-repl"
             },
             {
                     "id": "5eaba35b3099025c6492466a",
                     "groupId": "5e84b94c003f2d6370004f4e",
                     "alertConfigId": "5e84c02cb5289542e0c42bd2",
                     "eventTypeName": "OPLOG_BEHIND",
                     "created": "2020-05-01T04:19:39Z",
                     "updated": "2020-05-01T11:30:34Z",
                     "resolved": "2020-05-01T11:30:34Z",
                     "status": "CLOSED",
                     "lastNotified": "2020-05-01T11:30:44Z",
                     "replicaSetName": "cm-clstr-repl"
             }
     ],
     "totalCount": 3
}