Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli ops-manager alerts global list

On this page

  • Syntax
  • Options
  • Output
  • Examples

The alerts global list command retrieves all the global alerts for the specified Ops Manager project. You can also retrieve all the global alerts through the Ops Manager UI and API.

mongocli ops-manager|om alerts global list
[ --limit <number> ]
[ --output|-o <output-format> ]
[ --page <number> ]
[ --profile|-P <profile-name> ]
[ --projectId projectId ]

Note

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

Option
Type
Description
Required?
--limit
string
The number of alert records to return.
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 Go template file

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

no
--page
string
The page to return. For example, suppose there are 200 alerts. If limit is set to 100 and page is set to 2, the command will return records 101 to 200.
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

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

Field
Type
Description
alertConfigId
string
Unique identifier of the global alert configuration that triggered this alert.
created
date
When the alert was opened.
eventTypeName
string
The name of the event that triggered the alert.
groupId
string
Unique identifier of the project that this alert was opened for.
id
string
Unique identifier.
lastNotified
date
When the last notification was sent for this alert. Only present if notifications have been sent.
links
document array
One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
tags
array of strings
The tags associated with the alert.
updated
date
When the alert was last updated.

The following example uses the mongocli om alerts global list command to retrieve the list of global alerts for the specified project. It uses the default profile to access the Ops Manager project.

mongocli om alerts global list --projectId 5e84b2edf949e9007a7beac3 --output json

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

{
"links": [
{
"rel": "self",
"href": "http://om-svc.mongodb.svc.cluster.local:8080/api/public/v1.0/globalAlerts?pageNum=1\u0026itemsPerPage=100"
}
],
"results": [
{
"id": "5e8748024a658400782da935",
"groupId": "5e84b2edf949e9007a7beac3",
"alertConfigId": "5e8747db4a658400782da8bd",
"eventTypeName": "USERS_WITHOUT_MULTI_FACTOR_AUTH",
"created": "2020-04-03T14:28:18Z",
"updated": "2020-04-03T14:28:18Z",
"status": "OPEN",
"lastNotified": "2020-04-03T14:28:28Z",
"tags": [
"EXTERNALLY_MANAGED_BY_KUBERNETES",
"MONGODB"
],
"links": [
{
"rel": "self",
"href": "http://om-svc.mongodb.svc.cluster.local:8080/api/public/v1.0/globalAlerts/5e8748024a658400782da935"
}
]
}
],
"totalCount": 1
}

Back

Unacknowledge an Alert