mongocli cloud-manager alerts settings list
The alerts settings list
command retrieves all the alerts configured
in the specified Cloud Manager project. You can also retrieve all the
alerts configured in a project through the Cloud Manager API.
Syntax
mongocli cloud-manager|cm alerts settings|config list|ls [ --output|-o <output-format> ] [ --profile|-P <profile-name> ] [ --projectId <id-of-project> ] [ --page <page-number> ] [ --limit <items-per-page> ]
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. If omitted, uses the project ID in the profile or environment variable. NoteYou can retrieve the list of projects, including their IDs, using
the | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | 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
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 |
---|---|---|
created | string | Timestamp in ISO 8601 date and time format in UTC when this alert configuration was created. |
enabled | boolean | Flag indicating this alert configuration enabled. |
eventTypeName | string | Type of event that triggers an alert. For a complete list of alert events, see Alert Conditions. |
groupId | string | Unique identifier of the Project that owns this alert
configuration. |
id | string | Unique identifier for this alert configuration. |
matchers.fieldName | string | Name of the field in the target object to match on. Use the List alert configuration matcher fields to return the possible values. |
matchers.operator | string | Operator to test the field's value. Accepted values are:
|
matchers.value | string | Value to test with the specified operator. If
|
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 |
metricThreshold.metricName | string | The name of the metric whose value went outside the threshold. Only
applicable if
|
metricThreshold.mode | string | Average value of this metric. |
metricThreshold.operator | string | Operator to apply when checking the current metric value against the threshold value. Accepted values are:
|
metricThreshold.threshold | number | Threshold value outside of which an alert is triggered. |
metricThreshold.units | string | Units for the threshold value. Depends on the type of metric. ExampleA metric that measures memory consumption would have a byte measurement, while a metric that measures time would have a time unit. Accepted values are:
|
metricThreshold | object | Threshold that will cause an alert to be triggered.
Populated if "eventTypeName" :
"OUTSIDE_METRIC_THRESHOLD" . |
notifications.apiToken | string | Slack API token or Bot token. Populated for SLACK
notifications. If the token later becomes invalid, Cloud Manager
sends an email to the Project owner and eventually removes
the token. |
notifications.channelName | string | Slack channel name. Populated for SLACK notifications. |
notifications.delayMin | number | Number of minutes to wait after an alert condition is
detected before sending out the first notification. |
notifications.emailAddress | string | Email address to which to send notification. Populated for
EMAIL notifications. |
notifications.emailEnabled | boolean | Flag indicating email notifications must be sent. Populated
for ORG , GROUP , and USER notifications. |
notifications.flowdockApiToken | string | Flowdock "personal API token." Populated for
FLOWDOCK notifications. If the token later becomes
invalid, Cloud Manager sends an email to the Project owner and
eventually removes the token. |
notifications.flowName | string | Flow name, in lower-case letters. Populated for
FLOWDOCK notifications. The flow name appears after the
organization name in the URL string:
www.flowdock.com/app/<organization-name>/<flow-name> . |
notifications.intervalMin | number | Number of minutes to wait between successive notifications
for unacknowledged alerts that are not resolved. |
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. Populated for FLOWDOCK notifications. |
notifications.role | string | Cloud Manager role in current Project. Populated for GROUP
notifications. |
notifications.serviceKey | string | PagerDuty service key. Populated for PAGER_DUTY
notifications. If the key later becomes invalid, Cloud Manager sends
an email to the Project owner and eventually removes the key. |
notifications.smsEnabled | boolean | Flag indicating SMS notifications must be sent. Populated
for ORG , GROUP , and USER notifications. |
notifications.typeName | string | Type of alert notification. Accepted values are:
|
notifications.username | string | Name of the Cloud Manager user to which to send notifications. Only
a user in the Project that owns the alert configuration is
allowed here. Populated for USER notifications. |
notifications | object array | Notifications to send when an alert condition is detected. |
threshold.operator | string | Operator to apply when checking the current metric value against the threshold value.
|
threshold.threshold | number | Threshold value outside of which an alert is triggered. |
threshold | object | Threshold that will cause an alert to be triggered. Populated if
|
typeName | string | This field is deprecated and are ignored. |
updated | string | Timestamp in ISO 8601 date and time format in UTC when this alert configuration was last updated. |
Example
The following example uses the mongocli cm alerts settings list
command to retrieve the list of alerts configured in the specified
project. It uses the default profile to access the
Cloud Manager project.
mongocli cm alerts settings list --output json --projectId 5e4434626e68f6755b594125
The previous command prints the following fields in the specified format to the terminal. To learn more about these fields, see Output.
[ { "id": "5e7cbfdb1c8e2b221cfcf7fb", "groupId": "5e4434626e68f6755b594125", "eventTypeName": "MONITORING_AGENT_DOWN", "created": "2020-03-26T14:44:43Z", "updated": "2020-03-26T14:44:43Z", "enabled": true, "notifications": [ { "delayMin": 0, "emailEnabled": true, "intervalMin": 60, "smsEnabled": false, "typeName": "GROUP" } ] }, { "id": "5e7cbfdb1c8e2b221cfcf7fc", "groupId": "5e4434626e68f6755b594125", "eventTypeName": "HOST_SSL_CERTIFICATE_STALE", "created": "2020-03-26T14:44:43Z", "updated": "2020-03-26T14:44:43Z", "enabled": true, "notifications": [ { "delayMin": 0, "emailEnabled": true, "intervalMin": 1440, "smsEnabled": false, "typeName": "GROUP" } ] }, { "id": "5e7cbfdb1c8e2b221cfcf7fd", "groupId": "5e4434626e68f6755b594125", "eventTypeName": "HOST_EXPOSED", "created": "2020-03-26T14:44:43Z", "updated": "2020-03-26T14:44:43Z", "enabled": true, "notifications": [ { "delayMin": 0, "emailEnabled": true, "intervalMin": 60, "smsEnabled": false, "typeName": "GROUP" } ] }, { "id": "5e7cbfdb1c8e2b221cfcf7fe", "groupId": "5e4434626e68f6755b594125", "eventTypeName": "JOINED_GROUP", "created": "2020-03-26T14:44:43Z", "updated": "2020-03-26T14:44:43Z", "enabled": true, "notifications": [ { "delayMin": 0, "emailEnabled": true, "intervalMin": 60, "smsEnabled": false, "typeName": "GROUP" } ] } ]