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 atlas alerts configs list

On this page

The alerts configs list command retrieves all the alerts configured in the specified Atlas project.

Syntax

mongocli atlas alerts configs list|ls
     [ --projectId <id-of-project>  ]
     [ --page <page-number> ]
     [ --limit <items-per-page> ]
     [ --profile|-p <profile-name> ]

Options

Option Type Description Required?
--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 containing the cluster you want to update. no
--page integer Page number (1-based). Defaults to 1 if not specified. no
--limit integer Number of items to return per page, up to a maximum of 500. Defaults to 100 if not specified. no

Output

The command prints the following fields in JSON format to the terminal if the command succeeds. If the command returns an error, see Troubleshooting for recommended solutions.

Name Type Description
id string Specifies the unique identifier of the cluster.
groupId string

Specifies the unique identifier of the project.

Note

Groups and projects are synonymous terms. Your {GROUP-ID} is the same as your project ID.

eventTypeName string

Type of event that will trigger an alert.

Alert type Possible values
Host
OUTSIDE_METRIC_THRESHOLD
HOST_RESTARTED
HOST_UPGRADED
HOST_NOW_SECONDARY
HOST_NOW_PRIMARY
Replica set
NO_PRIMARY
TOO_MANY_ELECTIONS
Sharded cluster CLUSTER_MONGOS_IS_MISSING
User
JOINED_GROUP
REMOVED_FROM_GROUP
USER_ROLES_CHANGED_AUDIT
Project
USERS_AWAITING_APPROVAL
USERS_WITHOUT_MULTI_FACTOR_AUTH
GROUP_CREATED
Team
JOINED_TEAM
REMOVED_FROM_TEAM
Organization
INVITED_TO_ORG
JOINED_ORG
Data Explorer
DATA_EXPLORER
DATA_EXPLORER_CRUD
Billing
CREDIT_CARD_ABOUT_TO_EXPIRE
CHARGE_SUCCEEDED
INVOICE_CLOSED
created string Timestamp in ISO 8601 date and time format in UTC when this alert configuration was created.
updated string Timestamp in ISO 8601 date and time format in UTC when this alert configuration was last updated.
enabled boolean If set to true, the alert configuration is enabled.
metricThreshold object The threshold that causes an alert to be triggered. Populated if "eventTypeName" is "OUTSIDE_METRIC_THRESHOLD".
metricThreshold.metricName string Name of the metric against which Atlas checks the configured metricThreshold.threshold.
metricThreshold.operator string

Operator to apply when checking the current metric value against the threshold value. Accepted values are:

  • GREATER_THAN
  • LESS_THAN
metricThreshold.threshold integer Threshold value outside of which an alert will be triggered.
metricThreshold.units string

The units for the threshold value. Depends on the type of metric.

Example

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

Thresholds may use the following units:

  • RAW
  • BITS
  • BYTES
  • KILOBITS
  • KILOBYTES
  • MEGABITS
  • MEGABYTES
  • GIGABITS
  • GIGABYTES
  • TERABYTES
  • PETABYTES
  • MILLISECONDS
  • SECONDS
  • MINUTES
  • HOURS
  • DAYS
metricThreshold.mode string AVERAGE. Atlas computes the current metric value as an average.
notifications object array Notifications to send when an alert condition is detected.
notifications.delayMin integer Number of minutes to wait after an alert condition is detected before sending out the first notification.
notifications.intervalMin integer Number of minutes to wait between successive notifications for unacknowledged alerts that are not resolved.
notifications.emailEnabled boolean Flag indicating if email notifications should be sent. Populated for ORG, GROUP, and USER notifications types.
notifications.smsEnabled boolean Flag indicating if text message notifications should be sent. Populated for ORG, GROUP, and USER notifications types.
notifications.typeName string

Type of alert notification. Accepted values are:

  • DATADOG
  • EMAIL
  • FLOWDOCK
  • GROUP (Project)
  • OPS_GENIE
  • ORG
  • PAGER_DUTY
  • SLACK
  • SMS
  • TEAM
  • USER
  • VICTOR_OPS
  • WEBHOOK

Examples

The following example uses the mongocli atlas alerts configs list command to retrieve the list of alerts configured in the specified project. It uses the profile named myprofile for accessing the Atlas project.

~ mongocli atlas cluster list --projectId 5e4434626e68f6755b594125 --profile myprofile

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

[
   {
     "id": "5e4434626e68f6755b594126",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "REPLICATION_OPLOG_WINDOW_RUNNING_OUT",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b594127",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "NO_PRIMARY",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-03-03T21:00:41Z",
     "enabled": true,
     "notifications": [
       {
         "delayMin": 15,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b594128",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "CLUSTER_MONGOS_IS_MISSING",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "notifications": [
       {
         "delayMin": 15,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b594129",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "metricThreshold": {
       "metricName": "CONNECTIONS_PERCENT",
       "operator": "GREATER_THAN",
       "threshold": 80,
       "units": "RAW",
       "mode": "AVERAGE"
     },
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b59412a",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "metricThreshold": {
       "metricName": "DISK_PARTITION_SPACE_USED_DATA",
       "operator": "GREATER_THAN",
       "threshold": 90,
       "units": "RAW",
       "mode": "AVERAGE"
     },
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b59412b",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "metricThreshold": {
       "metricName": "DISK_PARTITION_UTILIZATION_DATA",
       "operator": "GREATER_THAN",
       "threshold": 90,
       "units": "RAW",
       "mode": "AVERAGE"
     },
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b59412c",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "metricThreshold": {
       "metricName": "QUERY_TARGETING_SCANNED_OBJECTS_PER_RETURNED",
       "operator": "GREATER_THAN",
       "threshold": 1000,
       "units": "RAW",
       "mode": "AVERAGE"
     },
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b59412d",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "CREDIT_CARD_ABOUT_TO_EXPIRE",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 1440,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b59412e",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "metricThreshold": {
       "metricName": "NORMALIZED_SYSTEM_CPU_USER",
       "operator": "GREATER_THAN",
       "threshold": 95,
       "units": "RAW",
       "mode": "AVERAGE"
     },
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b59412f",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "metricThreshold": {
       "metricName": "NORMALIZED_SYSTEM_CPU_STEAL",
       "operator": "GREATER_THAN",
       "threshold": 50,
       "units": "RAW",
       "mode": "AVERAGE"
     },
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   },
   {
     "id": "5e4434626e68f6755b594130",
     "groupID": "5e4434626e68f6755b594125",
     "eventTypeName": "JOINED_GROUP",
     "created": "2020-02-12T17:22:42Z",
     "updated": "2020-02-12T17:22:42Z",
     "enabled": true,
     "notifications": [
       {
         "delayMin": 0,
         "emailEnabled": true,
         "intervalMin": 60,
         "smsEnabled": false,
         "typeName": "GROUP"
       }
     ]
   }
]