Opspack Marketplace

Database - MongoDB

MongoDB Opspack Overview

MongoDB is a cross-platform, document-oriented database program and represents its documents in a binary-encoded JSON format called BSON (Binary JSON). The lightweight binary format adds speed to the flexibility of the JSON format, along with more data types. Fields inside MongoDB documents can also be indexed.

Mongo DB allows users to be agile and follow a stable process when running the most critical applications. Here are a few other highlight features: 

  • Expressive query language & secondary indexes 
  • Enterprise management and integration 
  • Strong consistency  
  • Always-on global deployments 

MongoDB Dashboard

What You Can Monitor

Opsview Monitor contains all the important service checks to make sure your MongoDB Server is up and running. Service Checks for MongoDB include:

  • CPU information for all of your MongoDB instances
  • Memory statistics including MongoDB_config and arbiter
  • Page Faults, database size, replication state and more

Checks​

asserts

chunks_balance

collection_indexes

collection_size

collection_state

collection_storageSize

connect_primary

connections

database_indexes

database_size

databases

flushing

index_miss_ratio

journaled

journal_commits

last_flush_time

memory

memory_mapped

opcounters

oplog

page_faults

queries_per_second

queues

replication_lag

replication_lag_percent

replset_quorum

replset_state

row_count

write_data_files

 

Download and install required packages

Pymongo is required to run this plugin and can be installed on your system by running:

apt-get install python-pip

pip install pymongo

This will install the latest version of pymongo to your system.

Setup for using all service checks

To get all the service checks working correctly, MongoDB must be set up with a database, collection, sharding and replicaset. Any of the service checks that are not needed should be disabled.

If you are not running sharding, then Chunks Balance should be disabled.

If MongoDB is running without replSet, then Rep Lag, Rep Lag percentage, Replset Quorum and Replset State should be disabled.

If you are running a MongoDB 3.2+ system, then Journal, Journal Commits and Write Data Files should be disabled as it uses WiredTiger as its storage engine.

Create a user with appropriate role for plugin to login as with MongoDB 

In order for this Opspack to work, it queries the admin database to get system-wide statistics about the database deployment.

It is recommended to set up a user in a role with permissions (at least) 'ClusterMonitor', as this role "Provides read-only access to monitoring tools for administering the whole system rather than just a single database".

For example, to create a user 'Opsview' with password 'Opsview' and role 'clusterMonitor':

    db = db.getSiblingDB("admin");

    db.createUser( { user:"opsview",pwd:"opsview",roles:["clusterMonitor"] } );

The Opspack can then use these credentials, which you enter into Opsview, to login and query metrics.

You are at liberty to instead allow Opsview to login as an already existing user with at least this level of role access.  

Step 1: Apply the host template

Step 2: Configure the MONGODB_CREDENTIALS and MONGODB_DATABASES variable

Step 3: Reload the system and monitor

Opsview Supported
Average rating: 
0

No votes yet

Runs on: 
Opsview
Author: 
twebb
twebb's picture
Opspack type: 
Database