npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mops-cli

v0.0.1

Published

A command-line interface for performing MongoDB Cloud Manager | Ops Manager tasks through their Public API

Downloads

5

Readme

MOPS

MOPS Mascot

A command-line interface for performing MongoDB Cloud Manager | Ops Manager tasks through their Public API.

Benefits

  • 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.

Installation

You can install the mops-cli npm package directly.

npm install -g mops-cli

Commands

The core mops commands are documented below.

configure

configure login

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

configure defaults

mops configure defaults -g GROUPID

Set defaults to prevent always specifying options on the command line.

| Options | Description | Default | | ----------------------|------------------------------------------------------|-------------------| | -g, --groupId [groupId] | Group identifier | |

groups

groups list

mops groups list

Display all current groups (JSON)

groups delete

mops groups delete -n GROUPNAME

Create new alert configurations

| Options | Description | Default | | ------------------------|------------------------------------------------------|-------------------| | -n, --name [name] | Group name | |

groups create

mops groups create -n GROUPNAME

hosts

hosts list

mops hosts list -g GROUPID

Display all current hosts (JSON)

| Options | Description | Default | | ------------------------|------------------------------------------------------|-------------------| | -g, --groupId [groupId] | Group identifier | |

metrics

metrics csv

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 |

alertConfigs

alertConfigs list

mops alertConfigs list -g GROUPID

Display all current alert configurations (JSON)

| Options | Description | Default | | ------------------------|------------------------------------------------------|-------------------| | -g, --groupId [groupId] | Group identifier | |

alertConfigs create

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

alertConfigs edit

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

automationConfig

automationConfig edit

mops automationConfig edit -g GROUPID

Edit the current automationConfig in your text editor

| Options | Description | Default | | ------------------------|------------------------------------------------------|-------------------| | -g, --groupId [groupId] | Group identifier | |

Example Workflows

Copying alerts configuration from one group to another

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)

Exporting host metrics into CSV format (for Excel, R, etc.)

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.

License

Licensed under the MIT license.

Contributors

Shout Outs

mops-cli is a MongoDB Skunkworks Project

Friendly Skunk