Navigation

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.

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.

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:

  • 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

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:

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
Give Feedback