Navigation

mongocli atlas alerts configs list

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

mongocli atlas alerts configs list|ls
[ --output|-o <output-format> ]
[ --projectId <id-of-project> ]
[ --page <page-number> ]
[ --limit <items-per-page> ]
[ --profile|-P <profile-name> ]
Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
--limit
integer
Number of items to return per page, up to a maximum of 500. Defaults to 100 if not specified.
no
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format
  • go-template for custom output using the Go template
  • go-template-file for custom output specified using the Go template file

If omitted, the command returns output in the default format.

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. If omitted, uses the project ID in the profile or environment variable.

no

If the command succeeds, it prints the subset of the following fields to the terminal in the specified format that describe each alert configuration. If the command returns an error, see Troubleshooting for recommended solutions.

Name
Type
Description
id
string
Unique identifier of the alert configuration.
groupId
string
Unique identifier of the project that owns this alert configuration.
eventTypeName
string

Type of event that triggers an alert.

For a complete list of alert events, see Alert Conditions.

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.

If enabled is not specified in a POST command, it defaults to false.

matchers
object array

Rules to apply when matching an object against this alert configuration. Only entities that match all these rules are checked for an alert condition.

You can filter using the matchers array only when the eventTypeName specifies an event for a host, replica set, or sharded cluster.

matchers
.fieldName
string

Name of the field in the target object to match on.

  • Host alerts support these fields:

    • TYPE_NAME
    • HOSTNAME
    • PORT
    • HOSTNAME_AND_PORT
    • REPLICA_SET_NAME
  • Replica set alerts support these fields:

    • REPLICA_SET_NAME
    • SHARD_NAME
    • CLUSTER_NAME
  • Sharded cluster alerts support these fields:

    • CLUSTER_NAME
    • SHARD_NAME

All other types of alerts do not support matchers.

matchers
.operator
string

Operator to test the field's value. Accepted values are:

  • EQUALS
  • NOT_EQUALS
  • CONTAINS
  • NOT_CONTAINS
  • STARTS_WITH
  • ENDS_WITH
  • REGEX
matchers
.value
string

Value to test with the specified operator.

If "matchers.fieldName" : "TYPE_NAME", you can match on the following values:

  • PRIMARY
  • SECONDARY
  • STANDALONE
  • CONFIG
  • MONGOS
metricThreshold
object
Threshold that causes an alert to be triggered. Populated if "eventTypeName" : "OUTSIDE_METRIC_THRESHOLD".
metricThreshold
.metricName
string

The name of the metric whose value went outside the threshold. Only applicable if --event 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
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

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.

Accepted values are:

  • 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
.typeName
string

Type of alert notification. Accepted values are:

  • DATADOG
  • EMAIL
  • FLOWDOCK
  • GROUP (Project)
  • OPS_GENIE
  • ORG
  • PAGER_DUTY
  • SLACK
  • SMS`
  • USER
  • VICTOR_OPS
notifications
.intervalMin
integer
Number of minutes to wait between successive notifications for unacknowledged alerts that are not resolved.
notifications
.delayMin
integer
Number of minutes to wait after an alert condition is detected before sending out the first notification.
notifications
.emailEnabled
boolean
Flag indicating if email notifications should be sent. Returned with ORG, GROUP, and USER notifications types.
notifications
.smsEnabled
boolean
Flag indicating if text message notifications should be sent. Returned with ORG, GROUP, and USER notifications types.
notifications
.username
string
Name of the Atlas user to which to send notifications. Only a user in the project that owns the alert configuration is allowed here. Returned with the USER notifications type.
notifications
.roles
array of strings

One or more project roles that receive the configured alert. Accepted values include:

  • GROUP_CHARTS_ADMIN
  • GROUP_CLUSTER_MANAGER
  • GROUP_DATA_ACCESS_ADMIN
  • GROUP_DATA_ACCESS_READ_ONLY
  • GROUP_DATA_ACCESS_READ_WRITE
  • GROUP_OWNER
  • GROUP_READ_ONLY
notifications
.teamId
string
Unique identifier of a team.
notifications
.emailAddress
string
Email address to which alert notifications are sent. Returned with the EMAIL notifications type.
notifications
.mobileNumber
string
Mobile number to which alert notifications are sent. Returned with the SMS notifications type.
notifications
.channelName
string
Slack channel name. Returned with the SLACK notifications type.
notifications
.apiToken
string
Slack API token or Bot token. Returned with the SLACK notifications type. If the token later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
notifications
.orgName
string
Flowdock organization name in lower-case letters. This is the name that appears after www.flowdock.com/app/ in the URL string. Returned with the FLOWDOCK notifications type.
notifications
.flowName
string

Flowdock flow name in lower-case letters. The flow name appears after the organization name in the URL string:

www.flowdock.com/app/<organization-name>/<flow-name>.

Returned with the FLOWDOCK notifications type.

notifications
.flowdockApiToken
string
Flowdock personal API token. Returned with the FLOWDOCK notifications type. If the token later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
notifications
.serviceKey
string
PagerDuty service key. Returned with the PAGER_DUTY notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
notifications
.victorOpsApiKey
string
VictorOps API key. Returned with the VICTOR_OPS notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
notifications
.victorOpsRoutingKey
string
VictorOps routing key. Returned with the VICTOR_OPS notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
notifications
.opsGenieApiKey
string
Opsgenie API Key. Returned with the OPS_GENIE notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
notifications
.opsGenieRegion
string

Region that indicates which API URL to use. Accepted regions are:

  • US
  • EU

The default Opsgenie region is US.

notifications
.datadogApiKey
string
Datadog API Key. Found in the Datadog dashboard. Populated for the DATADOG notifications type.
notifications
.datadogRegion
string

Region that indicates which API URL to use. Accepted regions are:

  • US
  • EU

The default Datadog region is US.

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 default profile to access the Atlas project.

mongocli atlas cluster list --projectId 5e4434626e68f6755b594125
--output json

The previous command prints the following fields in the specified 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"
}
]
}
]
Give Feedback