Navigation

mongocli cloud-manager servers list

On this page

The servers list command retrieves all hosts that are running an Automation Agent in the specified Cloud Manager project. These hosts might or might not be running mongod or mongos processes. You can also retrieve all the clusters in a project using the Ops Manager UI or API.

Syntax

mongocli cloud-manager|cm servers list|ls
     [ --profile|-P <profile-name> ]
     [ --projectId projectId ]

Note

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

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 that contains the cluster to update. If omitted, uses the project ID in the profile or environment variable. no

Output

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

Field Description
mongoURI The connection string used to access the Ops Manager Application Database.
name Name of the cluster.
processes Configuration information for mongod processes on the cluster.
processes.arbiterOnly

Flag that indicates whether or not the replica set member is an arbiter node. Value can be:

  • true if the member is an arbiter node
  • false if the member is a non-arbiter node
processes.buildIndexes Flag that indicates whether to direct mongod to build indexes. This setting corresponds to the buildIndexes mongod replica set configuration option.
processes.dbPath The location and name of the MongoDB log files.
processes.disabled

Flag that indicates whether or not the process is disabled. Value can be:

  • true if disabled
  • false if enabled
processes.featureCompatibilityVersion The Feature Compatibility Version of the deployment.
processes.hidden

Flag that indicates whether or not the replica set member is hidden. Value can be:

  • true if the member is hidden
  • false if the member is not hidden
processes.hostname The hostname of the replica set member.
processes.logPath The full path to the mongod log file, including the log file name and extension.
processes.name Hostname and port of the mongod process.
processes.port The IANA port number for the mongod process.
processes.priority The priority of the member during elections.
processes.processType Type of process. Value will be mongod.
processes.slaveDelay Number of seconds behind the primary that the replica set member should lag.
processes.version The MongoDB server version of the mongod process.
processes.votes Number of votes that the replica set member has during elections.

Example

The following mongocli cm servers list command returns the hosts that are running an Automation Agent in the specified project in JSON format. The command uses the default profile to access the specified project.

mongocli cm servers list --projectId 5e2dec2131cd7c007880b05e

Output

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

{
 "links": [
  {
   "rel": "self",
   "href": "http://cloud.mongodb.com/api/public/v1.0/groups/5e2dec2131cd7c007880b05e/agents/AUTOMATION?pageNum=1\u0026itemsPerPage=100"
  }
 ],
 "results": [
  {
   "typeName": "AUTOMATION",
   "hostname": "repl-0.repl-example.com",
   "confCount": 3074,
   "lastConf": "2020-03-25T20:12:12Z",
   "stateName": "ACTIVE",
   "pingCount": 0,
   "isManaged": false,
   "lastPing": "",
   "tag": null
  },
  {
   "typeName": "AUTOMATION",
   "hostname": "repl-1.repl-example.com",
   "confCount": 3117,
   "lastConf": "2020-03-25T20:12:12Z",
   "stateName": "ACTIVE",
   "pingCount": 0,
   "isManaged": false,
   "lastPing": "",
   "tag": null
  },
  {
   "typeName": "AUTOMATION",
   "hostname": "repl-2.repl-example.com",
   "confCount": 3141,
   "lastConf": "2020-03-25T20:12:12Z",
   "stateName": "ACTIVE",
   "pingCount": 0,
   "isManaged": false,
   "lastPing": "",
   "tag": null
  }
 ],
 "totalCount": 3
}