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

spm-agent-mongodb

v3.0.4

Published

SPM Agent for monitoring MongoDB

Downloads

122

Readme

Build Status

This is the MongoDB monitoring Agent for MongoDB Monitoring with Sematext Cloud.

Preparation

  1. Get a free Sematext account

  2. Create a Monitoring App of type "MongoDB" and copy the App Token - or execute the commands displayed in the Sematext UI (which are described here as well)

  3. Install Node.js on your MongoDB server

  4. The MongoDB driver might need libkrb5-dev for Kerberos authentication (if you use Kerberos ...)

apt-get install libkrb5-dev

Setup

# Install spm-agent-mongodb 
npm i spm-agent-mongodb -g

# In case you use Sematext Cloud EU (https://apps.eu.sematext.com): 
#   configure the API endpoints for EU. 
#   The  following commands create the file /etc/sematext/receivers.config: 
# sudo spm-mongodb-setup -r EU 
#   Note: To switch back to Sematext US region use
# sudo spm-mongodb-setup -r US # default for apps.sematext.com

# Install systemd or upstart service file for spm-agent-mongodb
# Create an SPM App of type MongoDB in Sematext UI 
# and use your SPM Token:
sudo spm-mongodb-setup -t SPM_TOKEN -m mongodb://localhost:27017/local

# or to specify the username and password for the agent to use to connect to MongoDB
sudo spm-mongodb-setup -t SPM_TOKEN -m mongodb://UsernameHere:PasswordHere@localhost:27017/DbNameHere

Note that the monitoring agent requires admin rights to query the relevant tables. It should have ClusterAdmin role and read access to any DB.

Configuration

The setup script will store your configuration in /etc/sematext/spm-agent-mongodb.config

If you want to change the settings later edit /etc/sematext/spm-agent-mongodb.config. Then restart the Sematext MongoDB Agent after config changes, depending on the init system:

  • Upstart (Ubuntu):
    sudo service spm-agent-mongodb restart 
  • Systemd (Linux others):
    sudo systemctl stop spm-agent-mongodb
    sudo systemctl start spm-agent-mongodb
  • Launchd (Mac OS X):
    sudo launchctl stop com.sematext.spm-agent-mongodb
    sudo launchctl stop com.sematext.spm-agent-mongodb

For tests you can just run the agent from command line:

spm-agent-mongodb SPM_TOKEN MONGODB_URL

Setup on Docker

The MongoDB agent is integrated in SPM-Client docker image. The relevant SPM_CONFIG string ist: mongodb SPM_TOKEN MONGODB_URL.

Run SPM-Client, replace the App Token and MongoDB URL with your configuration:

docker run --name spm-client --restart=always -v /var/run/docker.sock:/var/run/docker.sock -e SPM_CONFIG="mongodb YOUR_SPM_MONGODB_TOKEN mongodb://mongodbUser:mogodbPassword@mongodb-server:port/database" sematext/spm-client

Docker-Compose example with SPM-Client and MongoDB server: docker-compose.yml.

Results

Metrics Overview

More Information:

Support