Navigation

mongocli atlas process list

The process list command retrieves information about all running mongod and mongos processes for a given Atlas project.

mongocli atlas process list|ls
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]
Note

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

Option
Type
Description
Required?
--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
--profile, -P
string
Name of the profile where the project ID and the Programmatic API 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 prints an error, see Troubleshooting for recommended solutions.

process list returns an array of documents, each representing one MongoDB process within your Atlas project.

Name
Type
Description
created
DateTime
Date this MongoDB process was created.
groupId
string
ID of the project that owns the process.
hostname
string
Hostname of the machine running the process.
id
string
Hostname and port of the process in hostname:port format.
lastPing
DateTime
Date and time when the last ping for this process was received.
links
array of objects
One or more links to sub-resources and/or related resources.
port
number
Port on which the process listens.
shardName
string
Name of the shard this process belongs to. Only present if this process is part of a sharded cluster.
replicaSetName
string
Name of the replica set this process belongs to. Only present if this process is part of a replica set.
typeName
string

Type of process. Possible values are:

  • REPLICA_PRIMARY
  • REPLICA_SECONDARY
  • RECOVERING
  • SHARD_MONGOS
  • SHARD_CONFIG
  • SHARD_STANDALONE
  • SHARD_PRIMARY
  • SHARD_SECONDARY
  • NO_DATA

The type for new processes is NO_DATA until deployment of the process is complete.

version
string
Version of MongoDB running for this process.

The following example uses the mongocli atlas process list command to retrieve information about MongoDB processes running on the project. The command uses the default profile where the project ID and the Programmatic API Keys are stored.

mongocli atlas process list --output json

The previous example produces the following output:

[
{
"created": "2020-04-20T18:51:21Z",
"groupId": "5dd5a6b6f10fab1d71a58495",
"hostname": "atlas-ap6kaa-shard-00-00.qmajy.mongodb-dev.net",
"id": "atlas-ap6kaa-shard-00-00.qmajy.mongodb-dev.net:27017",
"lastPing": "2020-04-22T19:44:21Z",
"links": [
{
"rel": "self",
"href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5dd5a6b6f10fab1d71a58495/processes/atlas-ap6kaa-shard-00-00.qmajy.mongodb-dev.net:27017"
}
],
"port": 27017,
"shardName": "",
"replicaSetName": "atlas-ap6kaa-shard-0",
"typeName": "REPLICA_SECONDARY",
"version": "4.4.4"
},
{
"created": "2020-04-20T18:51:21Z",
"groupId": "5dd5a6b6f10fab1d71a58495",
"hostname": "atlas-ap6kaa-shard-00-01.qmajy.mongodb-dev.net",
"id": "atlas-ap6kaa-shard-00-01.qmajy.mongodb-dev.net:27017",
"lastPing": "2020-04-22T19:45:41Z",
"links": [
{
"rel": "self",
"href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5dd5a6b6f10fab1d71a58495/processes/atlas-ap6kaa-shard-00-01.qmajy.mongodb-dev.net:27017"
}
],
"port": 27017,
"shardName": "",
"replicaSetName": "atlas-ap6kaa-shard-0",
"typeName": "REPLICA_SECONDARY",
"version": "4.4.4"
},
{
"created": "2020-04-20T18:51:21Z",
"groupId": "5dd5a6b6f10fab1d71a58495",
"hostname": "atlas-ap6kaa-shard-00-02.qmajy.mongodb-dev.net",
"id": "atlas-ap6kaa-shard-00-02.qmajy.mongodb-dev.net:27017",
"lastPing": "2020-04-22T19:47:02Z",
"links": [
{
"rel": "self",
"href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5dd5a6b6f10fab1d71a58495/processes/atlas-ap6kaa-shard-00-02.qmajy.mongodb-dev.net:27017"
}
],
"port": 27017,
"shardName": "",
"replicaSetName": "atlas-ap6kaa-shard-0",
"typeName": "REPLICA_PRIMARY",
"version": "4.4.4"
}
]
Give Feedback