mongocli ops-manager servers list
The servers list
command retrieves all hosts that are running an
Automation Agent in the specified Ops 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 ops-manager|om servers list|ls [ --output|-o <output-format> ] [ --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? |
---|---|---|---|
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | 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 |
Output
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 | 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:
|
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:
|
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:
|
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 om servers list
command
returns the hosts that are running an Automation Agent in the specified
project in the specified format. The command uses the default profile to access the specified project.
mongocli om servers list --projectId 5e2dec2131cd7c007880b05e --output json
Output
The command prints the following fields to the terminal. To learn more about these fields, see Output.
{ "links": [ { "rel": "self", "href": "http://om-example.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 }