MongoDB Monitoring
--------------------
MongoDB monitoring provides a gateway configuration file that enables monitoring of MongoDB through a set of pre-configured Toolkit samplers.

Contents
--------------------
include/MongodbMonitoring.xml
    - Gateway configuration file containing Toolkit samplers configured for MongoDB monitoring.
    - This configuration should produce the following dataviews:
        * MongoDB-Asserts               This view reports the number of asserts on the database.
        * MongoDB-BackgroundFlushing    Information on this view only appears for instances that use the 
                                        MMAPv1 storage engine. mongod periodically flushes/writes to disk.
                                        In the default configuration, this happens every 60 seconds. This
                                        view contains data regarding these operations.  These metrics are
                                        important for write performance and journaling.
        * MongoDB-Cursors               This view contains data regarding cursor state and use.
        * MongoDB-dbStats               This view contains storage statistics for a given database. Users
                                        can pass their database to the provided script(see
                                        MONGODB_DB variable).
        * MongoDB-Locks                 This view provides a granular report on MongoDB database-level
                                        lock use.
        * MongoDB-Memory                This view contains memory metrics
        * MongoDB-Opcounters            This view provides an overview of database operations by type and
                                        makes it possible to analyze the load on the database in a more
                                        granular manner.  These numbers will grow over time and in response
                                        to database use.
        * MongoDB-Instance              This view contains a build summary for the mongo server instance.
        * MongoDB-ConcurrentTransactions Information on this view only appears for instances that use the
                                         wiredTiger storage engine. This contains ticket details that the
                                         wiredTiger uses for its thread management.
        * MongoDB-Replication           Information on this view appears only if replica set is used.
                                        Contains metrics related to replication.

include/MongodbMonitoring-SampleRules.xml
    - Gateway configuration file containing a set of sample rules that can be referred to in creating rules.

Prerequisites
--------------------
- MongoDB installed on the same node as the Netprobe that will use the samplers.
Note: The configuration file was verified with MongoDB version 3.6.


Installation
--------------------
** MongoDB Template Include File **
1. Open up the Gateway Setup Editor (double-click on the gateway in the Active Console)
2. In the Gateway Setup Editor, right click on the "Includes" folder (the top folder). Add a new include.
3. Enter in the path to the MongoDB Template and change the priority (to something other than 1). 
4. Load the new MongoDB include file by clicking on the plus sign by the new file, and then clicking "Click to load...".
5. The template uses the following variables whose default values are defined under <template.xml>->Environments->MongoDB-Defaults.
   They can be overridden on an managed entity level by using an environment in the managed entity where the type is defined.
    * MONGODB_CLIENT          Full path of the mongo client. The toolkit script uses this to communicate with the MongoDB instance. (Default: /usr/bin/mongo)
    * MONGODB_GROUP           Group name of all the Mongo Samplers. (Default: MongoDB)
    * MONGODB_DB              Specifies the name of the database to connect to. (Default: test)
    * MONGODB_CONNECTION      Format is: <host>:<port>, where host is the machine where mongod or mongos is running and port is where it is listening. (Default: localhost:27017)
    * MONGODB_SCRIPT_DIR      Directory where the sampler scripts will be generated. (Default: .)

** Gateway Netprobe Setup **
1. Create a managed entity
2. Under Basic->Add types, add MongoDB. Set the appropriate Environment if variables are going to be overridden.
