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

rabbitmq-manager

v1.1.3

Published

A RabbitMQ monitoring system written in NodeJS.

Downloads

2

Readme

RabbitMQ Manager

This utility began as a quick way to check the current queue status of a RabbitMQ instance. Whilst I was making use of the original tool, I decided that it made sense to expand to cover the entirety of the RabbitMQ Management APIs - which is what this utility is.

It's designed to be a light utility in order to quickly check on and modify queues without needing to log onto your servers etc. Please note that your server must have the RabbitMQ Management Plugin enabled to work with this utility.

Installation

Just install this module globally to have easy access to the utility. You must have NodeJS and NPM installed:

sudo npm install -g rabbitmq-manager

Which will allow you to access the utility using either rabbit or rabbit-manager commands.

Usage

There are two main drivers in this utility, query and queue. The queue command returns a representation of the current RabbitMQ (information from the /api/overview endpoint).

The query command is the entry command to calling any of the other RabbitMQ Management APIs. Read the Drivers section below to see an overview of each command.

Configurations

In order to make it easier to maintain multiple RabbitMQ clusters and setups, this utility contains the concept of configurations. You can create configurations using the rabbit set command, like below:

rabbit set <configuration-name>

You will then be prompted for the hostname, port and credentials. If you don't enter any of these fields, defaults will be used.

// Defaults

host : localhost
port : 15672
user : guest
pass : guest

This will set up a configuration with your settings, which you can use for quick access to a cluster later. You can also use rabbit unset <configs> to remove a stored configuration.

You can view the current configurations using rabbit config. This command takes an optional parameter of a specific configuration name in case you want to view a specific configuration.

Here's an example flow of using configurations:

$ rabbit set my-config

Please enter the desired host name: example.com
Please enter the desired port:
Please enter the desired username: some-user
Please enter the desired password: some-pass

Your configuration has been saved. You can use it by passing --conf.

$ rabbit config my-config
{
    "host": "example.com",
    "port": "15672",
    "username": "some-user",
    "password": "some-pass"
}

$ rabbit unset my-config

$ rabbit config
{}

You can also use rabbit import and rabbit export to import/export your configuration file. rabbit import takes a parameter of either a file path, or just raw JSON. rabbit export takes a parameter of the file to output to, but defaults to config.json in the current directory if none is provided.

Drivers

As mentioned previously, the two main drivers of this utility are queue and query. Both of these commands take these parameters:

-c, --conf, --config

-p, --pass, --password
-u, --user, --username

--rabbit-host
--rabbit-port

If a configuration isn't specified (see the section above), the rest of the flags are required, however they will revert to default values (again, see above) if not provided. In addition to these flags, each command has some unique arguments.

rabbit queue

Prints a representation of the current RabbitMQ status. Can be used to poll the status every X seconds in order to keep checking on a queue. This feature is controlled via the --poll flag. If a value isn't specified alongside --poll a 5 second poll is used. Below is an example of the output of this command:

$ rabbit queue --conf test-conf

Messages are moving at the below rates:

Publish:      	 33.6/s
Deliver:      	   19/s
Redelivered:  	    0/s
Acknowledged: 	 18.8/s

There are currently no backed up messages.

rabbit query

Used to call any of the RabbitMQ APIs, returning the raw (but formatted) JSON responses. This command accepts the following flags:

--api
--method
--payload

where --api is the RabbitMQ API to call, --method is the method to call it with, and --payload is the payload to use alongside the request (if needed). This payload needs to be wrapped in quotes to be properly parsed.

Here is an example of rabbit query in use:

$ rabbit query --api /api/vhosts --conf test-conf
[
    {
        "message_stats": {
            "ack": 70519730,
            "ack_details": {
                "rate": 0
            },
            "deliver": 70520060,
            "deliver_details": {
                "rate": 0
            },
            "deliver_get": 70520060,
            "deliver_get_details": {
                "rate": 0
            },
            "publish": 141152197,
            "publish_details": {
                "rate": 0
            },
            "redeliver": 330,
            "redeliver_details": {
                "rate": 0
            }
        },
        "messages": 0,
        "messages_details": {
            "rate": 0
        },
        "messages_ready": 0,
        "messages_ready_details": {
            "rate": 0
        },
        "messages_unacknowledged": 0,
        "messages_unacknowledged_details": {
            "rate": 0
        },
        "recv_oct": 30344468667,
        "recv_oct_details": {
            "rate": 0
        },
        "send_oct": 18771209205,
        "send_oct_details": {
            "rate": 0
        },
        "name": "/",
        "tracing": false
    }
]

Misc.

If you have any suggested improvements, or find any issues with this module, leave a note in the issues section. Feel free to reach out to me if you have any questions.