Supported Target Versions
Validated on MongoDB version 6.0.10

Application Version Details

Application VersionBug fixes / Enhancements
1.0.0Initial version with discovery, monitoring, alerts.

Introduction

MongoDB is a NoSQL database management application. NoSQL database systems offer an alternative to traditional relational databases using SQL (Structured Query Language). Data is stored in tables, rows, and columns in a relational database, with relationships between entities. MongoDB is a widely used, open-source, NoSQL (Not Only SQL) database. Here are some key points about MongoDB:

  • Document-Oriented Database
  • Flexible Schema
  • Scalability
  • High Performance
  • Aggregation Framework
  • Replication and High Availability

Key Use cases

Discovery Use cases

  • It discovers the MongoDB cluster and its component nodes.
  • Publishes relationships between resources to have a topological view and ease of maintenance.

Monitoring Use cases

  • Provides metrics related to job scheduling time and status etc..
  • Concern alerts will be generated for each metric to notify the administrator regarding the issue with the resource.

Prerequisites

  • OpsRamp Classic Gateway 14.0.0 and above.

  • OpsRamp Nextgen Gateway 14.0.0 and above.
    Note: OpsRamp recommends using the latest Gateway version for full coverage of recent bug fixes, enhancements, etc..

  • Provided IPAddress/hostname, Credentials (SSH and MongoDB database) should work for accessing MongoDB clusters.

  • The SSH credentials should be same for all the MongoDB replica set cluster nodes.

  • The MongoDB credentials should be the same for all the MongoDB replica set node instances.

  • We are using macAddress as a uniqueId for resource creation. To fetch the MAC Address we are using the ip addr show command. So we need ip command path in PATH environment variable, please add below mentioned lines in .profile or .bashrc file in all the MongoDB servers ( User should have a home directory then only .bash_profile or .bashrc file will be present).

    PATH={ipPath}:$PATH
    export PATH

    Notes:

    • Where ipPath is path where ip command binary is present. for example: if ip command is present in “/usr/sbin”, then provide PATH=/usr/sbin:$PATH
    • As we are utilizing a remote SSH connection, if the environment PATH does not include the binary path for the command, you may encounter a ‘command not found’ exception.
  • As part of discovery we are fetching the serial number and system UUID of the individual nodes. These details are fetched through command-line(SSH).

    • If the SSH credentials being provided are “root” users, no changes need to be made.
    • If the SSH credentials being provided are of a “non-sudo” user, then we need to make an entry in the /etc/sudoers file as below:
Dell PowerFlex
  • With the above entry, we will be able to execute that sudo command.

  • For connecting to the mongoDB instance, a user with “readAnyDatabase” and “clusterMonitor” role on the “admin” database will suffice. In case of replica set clusters the same user credential is expected to be available on all the nodes.

    For example we have created the user as below:

Dell PowerFlex
  • We are using both SSH credentials (for ssh/cli access) and mongoDB instance credentials(for mongoDB instance connection). You may connect to the mongoDB instance using a connection string.

  • MongoDB hosts should be resolvable from the gateway.

    • If you are using the NextGen gateway and the hosts are not resolving from the gateway and vprobe container.

      See How to manually add DNS Name Servers to k3s? to manually add DNS name servers to k3s

    • If you are using the classic gateway, please add a DNS server entry in the resolv.conf file or mention hosts in the /etc/hosts file.

Hierarchy of MongoDB resources

For a replica set cluster:

    • MongoDB Replica Set
             • MongoDB Server

For a standalone MongoDB instance:

    • MongoDB Server

You may take the node ip, either standalone or one replica set node (in case of replica set cluster) and the concerned port as input as part of configuration. You would require ssh credentials for the mongoDB server and mongoDB instance credentials as well for executing the remote SSH/ CLI commands.

Default Monitoring Configurations

MongoDB has default Global Device Management Policies, Global Templates, Global Monitors and Global metrics in OpsRamp. Users can customize these default monitoring configurations as per their business use cases by cloning respective global templates and global Device Management Policies. OpsRamp recommends doing this activity before installing the app to avoid noise alerts and data.

  1. Default Global Device Management Policies

    OpsRamp has a Global Device Management Policy for each Native Type of MongoDB. We can find those Device Management Policies at Setup > Resources > Device Management Policies, search with suggested names in global scope. Each Device Management Policy follows below naming convention:

    {appName nativeType - version}

    Ex: mongodb MongoDB Replica Set - 1(i.e, appName = mongodb, nativeType = MongoDB Replica Set , version = 1)

  2. Default Global Templates

    OpsRamp has a Global template for each Native Type of MongoDB. You can find those templates at Setup > Monitoring > Templates, search with suggested names in global scope. Each template follows below naming convention:

    {appName nativeType 'Template' - version}

    Ex: mongodb MongoDB Replica Set Template- 1(i.e, appName = mongodb, nativeType = MongoDB Replica Set, version = 1)

  3. Default Global Monitors

    OpsRamp has have a Global Monitors for each Native Type which has monitoring support. You can find those monitors at Setup > Monitoring > Monitors, search with suggested names in global scope. Each Monitors follows below naming convention:

    {monitorKey appName nativeType - version}

    Ex: MongoDB Replica Set Monitor mongodb MongoDB Replica Set 1 (i.e, monitorKey =MongoDB Replica Set Monitor, appName = mongodb, nativeType = MongoDB Replica Set , version = 2)

Configure and Install the MongoDB Integration

  1. From All Clients, select a client.
  2. Go to Setup > Account.
  3. Select the Integrations and Apps tab.
  4. The INSTALLED INTEGRATIONS page, where all the installed applications are displayed.
    Note: If there are no installed applications, it will navigate to the ADD APP page.
  5. Click + ADD on the INSTALLED INTEGRATIONS page. The AVAILABLE INTEGRATIONS AND APPS page displays all the available applications along with the newly created application with the version.
    Note: You can even search for the application using the search option available. Also you can use the All Categories option to search.
Dell PowerFlex
  1. Click ADD in the MongoDB application.
  2. In the Configurations page, click + ADD. The Add Configuration page appears.
  3. Enter the below mentioned BASIC INFORMATION:
FunctionalityDescription
NameEnter the name for the configuration.
IP Address/Host Name of MongoDB ServerIP Address/Hostname of the target.
SSH PortSSH Port
Note: By default 22 is the port value
SSH CredentialsSelect the SSH credentials from the drop-down list.
Note: Click + Add to create a credential.
MongoDB PortMongoDB Port
Note: By default 27017 is the prot value.
MongoDB Instance CredentialsSelect the MongoDB Instance Credentials from the drop-down list.
Note: Click + Add to create a credential.

Notes:

  • IP Address/Host Name should be accessible from Gateway.
  • App Failure Notifications: if turned on, you will be notified in case of an application failure that is, Connectivity Exception, Authentication Exception.
  1. Select the below mentioned Custom Attribute:
FunctionalityDescription
Custom AttributeSelect the custom attribute from the drop down list box.
ValueSelect the value from the drop down list box.

Note: The custom attribute that you add here will be assigned to all the resources that are created by the integration. You can add a maximum of five custom attributes (key and value pair).

  1. In the RESOURCE TYPE section, select:
    • ALL: All the existing and future resources will be discovered.
    • SELECT: You can select one or multiple resources to be discovered.
  2. In the DISCOVERY SCHEDULE section, select Recurrence Pattern to add one of the following patterns:
    • Minutes
    • Hourly
    • Daily
    • Weekly
    • Monthly
  3. Click ADD.
Dell PowerFlex

Now the configuration is saved and displayed on the configurations page after you save it.
Note: From the same page, you may Edit and Remove the created configuration.

  1. Click Next.
  2. Below are the optional steps you can perform on the Installation page.
  • Under the ADVANCED SETTINGS, Select the Bypass Resource Reconciliation option, if you wish to bypass resource reconciliation when encountering the same resources discovered by multiple applications.

    Note: If two different applications provide identical discovery attributes, two separate resources will be generated with those respective attributes from the individual discoveries.

Cisco FirePower
  • Click +ADD to create a new collector by providing a name or use the pre-populated name.
Aruba Airwave Integrations
  1. Select an existing registered profile.
Aruba Airwave Integrations
  1. Click FINISH.

The application is now installed and displayed on the INSTALLED INTEGRATION page. Use the search field to find the installed application.

Modify the Configuration

View the MongoDB Details

To discover resources for MongoDB, you have two options:

Option 1:

Navigate to Infrastructure > Resources > Cluster, with Native Resource Type as MongoDB Replica Set. You can go to the Attributes tab to view the discovery details.

Dell PowerFlex

Option 2:

  1. Navigate to Infrastructure > Search > DATABASES > MongoDB.
  2. The MONGODB page is displayed, select the application name.
  3. The RESOURCE DETAILS page appears from the right.
  4. Click the ellipsis () on the top right and select View details.
Dell PowerFlex
  1. Navigate to the Attributes tab to view the discovery details.
Dell PowerFlex
  • Click the Metrics tab to view the metric details for MongoDB.

View resource metrics

To confirm MongoDB monitoring, review the following:

  • Metric graphs: A graph is plotted for each metric that is enabled in the configuration.
  • Alerts: Alerts are generated for metrics that are configured as defined for integration.
Dell PowerFlex

Resource Filter Input keys

MongoDB application Resources are filtered and discovered based on below keys:

Click here to view the Supported Input Keys
Resource TypeSupported Input Keys
All TypesresourceName
hostName
aliasName
dnsName
ipAddress
macAddress
os
make
model
MongoDB ServerArbiter Node
Member Id
MongoDB Version

Supported Alert Custom Macros

Customize the alert subject and description with below macros then it will generate alert based on customisation.
Supported macros keys:

Click here to view the alert subject and description with macros

                                ${resource.name}

                                ${resource.ip}

                                ${resource.mac}

                                ${resource.type}

                                ${resource.make}

                                ${resource.model}

                                ${resource.serialnumber}

                                ${resource.systemId}

                                ${parent.resource.name}

                                            ${Custom attributes on the resource}

Supported Metrics

Click here to view the supported metrics
Native TypeMetric NameDisplay NameUnitsApplication VersionDescription
MongoDB Replica Setmongodb_cluster_FailoverStatusMongoDB Cluster Failover StatusNone1.0.0Metric represents if failover happened in the replica set cluster. Possible values are : NoFailover - 0, FailoverHappened - 1
mongodb_cluster_TotalNodesMongoDB Cluster Total Nodescount1.0.0Total number of MongoDB instances in the replica set cluster
mongodb_cluster_ActiveClientsMongoDB Cluster Active Clientscount1.0.0Total number of active client connections to the database.
mongodb_cluster_ActiveReadClientsMongoDB Cluster Active Read Clientscount1.0.0Count of the active client connections performing read operations.
mongodb_cluster_ActiveWriteClientsMongoDB Cluster Active Write Clientscount1.0.0Count of active client connections performing write operations.
mongodb_cluster_CurrentQueueMongoDB Cluster Current Queuecount1.0.0Current Queue.
mongodb_cluster_CurrentQueueReadersMongoDB Cluster Current Queue Readerscount1.0.0Current readers in Queue.
mongodb_cluster_CurrentQueueWritersMongoDB Cluster Current Queue Writerscount1.0.0Current writers in Queue.
MongoDB Servermongodb_server_ReplicationStateMongoDB Server Replication StateNone1.0.0MongoDB server replication state. Possible values are :PRIMARY :0 ,SECONDARY :1,DOWN :2,RECOVERING :3,STARTUP :4,STARTUP2 :5,FATAL :6,UNKNOWN :7
Note: This metric is not supported in MongoDB standalone server.
mongodb_server_UptimeMongoDB Server Uptimem1.0.0MongoDB server Uptime in minutes.
mongodb_server_MessageAssertsMongoDB Server Message Assertscount1.0.0The number of messages asserts. These are typically used for logging and informational purposes.
mongodb_server_RegularAssertsMongoDB Server Regular Assertscount1.0.0The number of regular asserts, which typically involve checks on data integrity and validation.
mongodb_server_RolloverAssertsMongoDB Server Rollover Assertscount1.0.0The number of times the assert counters have rolled over. When the maximum value for an assert counter is reached, it rolls over to zero.
mongodb_server_TotalAssertsMongoDB Server Total Assertscount1.0.0An aggregate count of all assertion checks, and it can provide insights into the overall health and reliability of your MongoDB server.
mongodb_server_UserAssertsMongoDB Server User Assertscount1.0.0The number of users asserts, which can be raised by user-defined functions in MongoDB, such as those in JavaScript stored procedures.
mongodb_server_WarningAssertsMongoDB Server Warning Assertscount1.0.0The number of warning asserts. These are non-fatal issues that MongoDB has detected but does not necessarily indicate data corruption.
mongodb_server_AvailableConnectionsMongoDB Server Available Connectionscount1.0.0The number of unused, available connections that can be used by clients to connect to the server. It represents the pool of connections available for new client connections.
mongodb_server_CurrentConnectionsMongoDB Server Current Connectionscount1.0.0The number of active connections to the MongoDB server. This represents the total number of currently open connections.
mongodb_server_cachedCursorsMongoDB Server Cached Cursorscount1.0.0The number of cursors currently cached in memory. Cursor caching is used to optimize query performance.
mongodb_server_OpenCursorsMongoDB Server Open Cursorscount1.0.0The current count of open cursors.
mongodb_server_CursorsTimeoutMongoDB Server Cursors Timeoutcount1.0.0The number of cursors that have timed out and been closed due to inactivity. This metric provides insights into cursor efficiency and system resource management.
mongodb_server_HeapUsageMongoDB Server Heap UsageBytes1.0.0MongoDB server heap usage.
mongodb_server_MemoryMongoDB Server MemoryBytes1.0.0The amount of memory used by the mongoDB server.
mongodb_server_ResidentMemoryMongoDB Server Resident MemoryBytes1.0.0The amount of memory (in bytes) currently used by the MongoDB server process for data, indexes, and other memory-mapped files that are in physical RAM.
mongodb_server_VirtualMemoryMongoDB Server Virtual MemoryBytes1.0.0The virtual memory size (in bytes) of the MongoDB server process.
mongodb_server_NetworkRequestsMongoDB Server Network Requestscount1.0.0The cumulative count of client requests that have been processed by the MongoDB server since it was last started.
mongodb_server_OpCountersMongoDB Server Op Counterscount1.0.0OpCounters for a mongodb server.
mongodb_server_OpCountersCommandMongoDB Server Opcounters commandcount1.0.0The total number of commands executed.
mongodb_server_OpCountersDeleteMongoDB Server Opcounters Deletecount1.0.0The total number of delete operations executed.
mongodb_server_OpCountersGetMongoDB Server Opcounters Getcount1.0.0The total number of "get more" operations.
mongodb_server_OpCountersInsertMongoDB Server Opcounters Insertcount1.0.0The total number of insert operations performed.
mongodb_server_OpCountersQueryMongoDB Server Opcounters Querycount1.0.0The total number of query operations executed
mongodb_server_OpCountersUpdateMongoDB Server Opcounters Updatecount1.0.0The total number of update operations performed.
mongodb_server_PageFaultsMongoDB Server Page Faultscount1.0.0The number of page faults that have occurred on the MongoDB server.
mongodb_server_network_BytesInMongoDB Server Netwotk Bytes InBytes1.0.0The total number of bytes received by the MongoDB server over the network since the server was last started.
mongodb_server_network_BytesOutMongoDB Server Network Bytes OutBytes1.0.0The total number of bytes sent by the MongoDB server over the network since the server was last started.
mongodb_server_network_PhysicalBytesInMongoDB Server Network Physical Bytes InBytes1.0.0The physical network traffic that is received at network interface level.
mongodb_server_network_PhysicalBytesOutMongoDB Server Network Physical Bytes OutBytes1.0.0The physical network traffic that is sent at network interface level
mongodb_server_NumRequestsMongoDB Server Number of Requestscount1.0.0The total number of client requests received by the MongoDB server since it started.
mongodb_server_IndexSizeMongoDB Server Index SizeBytes1.0.0The total size of all indexes on collections in the database, in bytes.
mongodb_server_SizeMongoDB Server Database SizeBytes1.0.0The total size that has been allocated for the database.

Risks, Limitations & Assumptions

  • Application can handle Critical/Recovery failure alert notifications for below two cases when user enables App Failure Notifications in configuration
    • Connectivity Exception
    • Authentication Exception
  • Application cannot control monitoring pause/resume actions based on above alerts. Metrics can be used to monitor PowerMax resources and can generate alerts based on the threshold values.
  • OpsRamp has provided 22 as default Port for SSH and 27017 as default Port for MongoDB. Users can modify this value from the application configuration page at any point of time if required.
  • Component level thresholds can be configured on each resource level.
  • No support of showing activity log and applied time.
  • The minimum supported version for the option to get the latest snapshot metric is NextGen-14.0.0.
  • This application supports both Classic Gateway and NextGen Gateway.
  • Application will send any duplicate/repeat failure alert notification for every 6 hours.
  • This application will work only if each Mongo DB instance is configured on different server.