A command-line interface for performing MongoDB Cloud Manager | Ops Manager tasks through their Public API.
- Easily do things from the terminal that are available to the UI and API.
- Quickly add new commands to automate things you'd like.
- Quickly move data back and forth between Cloud Manager an Ops Manager.
- Run custom analytics on permformance metrics data in Excel, R, etc.
- Leverages node-mms-client JS API wrapper, a Node wrapper around the public API.
You can install the mops-cli npm package directly.
npm install -g mops-cli
The core mops commands are documented below.
mops configure login -h HOSTNAME -p PORT -u USERNAME -a APIKEY
Set user credentials for MongoDB Cloud Manager | Ops Manager
| Options | Description | Default |
|---|---|---|
| -h, --host [host] | The API endpoint hostname | cloud.mongodb.com |
| -p, --port [port] | The API endpoint port | 443 |
| -P, --protocol [protocol] | The API endpoint protocol | https |
| -u, --user [user] | Email address or username accessing the API | |
| -a, --apiKey [apiKey] | The specified user's API key |
mops configure defaults -g GROUPID
Set defaults to prevent always specifying options on the command line.
| Options | Description | Default |
|---|---|---|
| -g, --groupId [groupId] | Group identifier |
mops groups list
Display all current groups (JSON)
mops groups delete -n GROUPNAME
Create new alert configurations
| Options | Description | Default |
|---|---|---|
| -n, --name [name] | Group name |
mops groups create -n GROUPNAME
mops hosts list -g GROUPID
Display all current hosts (JSON)
| Options | Description | Default |
|---|---|---|
| -g, --groupId [groupId] | Group identifier |
mops metrics csv -g GROUPID -h HOSTID
Export all metrics for the specified host in CSV format
| Options | Description | Default |
|---|---|---|
| -g, --groupId [groupId] | Group identifier | |
| -h, --hostId [hostId] | Host identifier | |
| -G, --granularity [granularity] | Granularity | MINUTE |
| -P, --period [period] | Period | P1DT24H |
mops alertConfigs list -g GROUPID
Display all current alert configurations (JSON)
| Options | Description | Default |
|---|---|---|
| -g, --groupId [groupId] | Group identifier |
mops alertConfigs create -g GROUPID -f myAlerts.json
Create new alert configurations
| Options | Description | Default |
|---|---|---|
| -g, --groupId [groupId] | Group identifier | |
| -f, --file [filename] | JSON file of alert configs |
mops alertConfigs edit -g GROUPID -i ALERTCONFIGID
Edit specified alertConfig in your text editor
| Options | Description | Default |
|---|---|---|
| -g, --groupId [groupId] | Group identifier | |
| -i, --alertConfigId [alertConfigId] | Alert Configuration identifier |
mops automationConfig edit -g GROUPID
Edit the current automationConfig in your text editor
| Options | Description | Default |
|---|---|---|
| -g, --groupId [groupId] | Group identifier |
mops alertConfigs list -g GROUPID > myAlerts.json
mops alertConfigs create -g GROUPID -f myAlerts.json
Note: You can do a mops configure login between these two commands to change username, API key, even hosts (i.e., move from Cloud Manager to Ops Manager)
Run mops host list to get a list of all the host IDs in your group.
Then run mops metrics csv -g GROUPID -h HOSTID > hostMetrics.csv to put all that host's metrics into a CSV file.
Licensed under the MIT license.
- Dennis Kuczynski @denniskuczynski
- Emily Pakulski @ohEmily
- Peter Gravelle @PeaSeaGee
- Daiji Shikama @deerspace
We're happy to discuss mops in our Gitter chatroom
mops-cli is a MongoDB Skunkworks Project

