mongocli ops-manager agent versions list
The agent versions list
command retrieves a list of all
MongoDB Agents and their versions in one Ops Manager project that you
specify. You can also retrieve this information using the
Ops Manager
UI or API.
Syntax
mongocli ops-manager|om agent|s version|s list|ls [--projectId <project-ID>] [--profile|-P <profile-name>] [ --output|-o <output-format> ]
Note
Use -h
or --help
to view the command-line help for
this command.
Options
Option | Type | Description | Required? |
---|---|---|---|
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. | no |
--profile , -P | string | Name of the profile where the public and private keys for the project are set. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI. | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
Output
If the command succeeds, it returns the following output in the default format. If the command returns errors, see Troubleshooting for recommended solutions.
HOSTNAME ADDRESS VERSION DEPRECATED <domain-name> <ip-address> <agent-version> <true-or-false>
The default output is a subset of the fields returned by this command. For the complete list of JSON fields returned by the command, see the Public API reference for your MongoDB service:
Example
The following command retrieves a list of all MongoDB Agents and their versions in one Ops Manager project that you specify using the default profile, which contains credentials to access the project and the project ID. The output is returned in the default format.
mongocli om agent versions list
The previous command prints the following to the terminal.
HOSTNAME ADDRESS VERSION DEPRECATED repl-0.example.com 192.0.2.0 10.14.18.6453 false repl-1.example.com 192.0.2.1 10.14.18.6453 false repl-2.example.com 192.0.2.2 10.14.18.6453 false
The following command retrieves a list of all MongoDB Agents and their versions in one Ops Manager project that you specify using the default profile, which contains credentials to access the project and the project ID. The output is returned in JSON format.
mongocli om agent versions list --output json
The previous command prints the following to the terminal in JSON format.
{ "count": 3, "entries": [ { "address": "192.0.2.0", "confCount": 1710429, "hostname": "repl-0.example.com ", "hostnameShort": "repl-0.example.com ", "isManaged": true, "isModule": true, "isPrimary": false, "isVersionOld": false, "isVersionDeprecated": false, "lastConf": 1611174341721, "lastPing": 0, "msSinceLastConf": 9940, "numProcess": 1, "pingCount": 0, "pingState": "ok", "tagName": "", "version": "10.14.18.6453" }, { "address": 192.0.2.1", "confCount": 1523759, "hostname": "repl-1.example.com , "hostnameShort": "repl-1.example.com ", "isManaged": true, "isModule": true, "isPrimary": false, "isVersionOld": false, "isVersionDeprecated": false, "lastConf": 1611174341715, "lastPing": 0, "msSinceLastConf": 9946, "numProcess": 0, "pingCount": 0, "pingState": "ok", "tagName": "", "version": "10.14.18.6453" }, { "address": "192.0.2.2", "confCount": 1523745, "hostname": "repl-2.example.com ", "hostnameShort": "repl-2.example.com ", "isManaged": true, "isModule": true, "isPrimary": false, "isVersionOld": false, "isVersionDeprecated": false, "lastConf": 1611174341715, "lastPing": 0, "msSinceLastConf": 9946, "numProcess": 0, "pingCount": 0, "pingState": "ok", "tagName": "", "version": "10.14.18.6453" } ], "isAnyAgentNotManaged": false, "isAnyAgentVersionDeprecated": false, "isAnyAgentVersionOld": false, "links": [ { "rel": "self", "href": "http://om.example.com/api/public/v1.0/groups/5f1f39ffc902201990f53873/agents/current" }, { "rel": "http://mms.mongodb.com/group", "href": "http://om.example.com/api/public/v1.0/groups/5f1f39ffc902201990f53873" } ], "minimumAgentVersionDetected": "10.14.18.6453", "minimumVersion": "10.14.0.6306" }