» MongoDB

Logicmonitor utilizes a native MongoDB driver to gather statistics on MongoDB instances. We provide some statistics via the following datasources:

MongoDB- general server statistics such as operations/s, memory usage, locks, etc

and will soon also have available:

MongoDBJournal- statistics on write-ahead journaling of operations (when enabled)
MongoDBReplStatus- Replication statistics

Information is garnered via standard commands executed on the instance (eg "serverStatus").  While we provide basic monitoring, it is also possible to create your own datasources to gather information out of MongoDB that is specific to your data and application.   Any normal MongoDB query is valid.

Getting started - default setup (no auth, default port)

By default MongoDB listens on port 27017 and does not have authentication configured.  If this is your setup, then MongoDB monitoring will be automatically discovered and monitoring will begin immediately on your database once it is added to LogicMonitor.  If your host does not display any MongoDB* datasources, run Active Discovery on your host by right-clicking on the hostname in LogicMonitor and selecting "More ..." -> "Run Active Discovery".  Click on your host again to refresh the page after about 20 seconds.

Default port with authentication

If authentication is in use you will need to supply the username and password by setting two properties on the host itself. The properties are:

mongodb.user
mongodb.pass

Properties can be added globally, on a host group level, or per-host by right-clicking on the host/host group -> "Edit..." -> "Properties (Add)"

Add Property

Non-default port or multiple instances on the same host

If running on a port other than the default 27017, or if you have multiple MongoDB instances running on the same host, you will need to set a system property (using the same procedure, described above, in setting a username and password). The property to set is:

mongodb.ports

the value(s) is a comma separated list of ports. After setting this property and submitting the value, refresh your screen after about 10 seconds and your MongoDB instances should be discovered.

What is being monitored?

Most of the information that is returned by "db.serverStatus()". Please see the following MongoDB page for information on the statistics

http://www.mongodb.org/display/DOCS/serverStatus+Command

Additional information on replication will be gathered from other sources later on.

Custom MongoDB Datasources

With the new MongoDB collector, LogicMonitor provides for the ability to query, alert on and graph arbitrary data returned by MongoDB queries. The best way to get a handle on how to do this is to view the MongoDB- datasource and see how we are parsing db.serverStatus(). A quick example for getting 'uptime' and 'globalLock currentQueue readers' from the below results:

uptime:
output.uptime

currentQueue readers:
output.GlobalLock.currentQueue.readers


> db.serverStatus()
{
"host" : "jb-vm-centos.sb.logicmonitor.net",
"version" : "1.8.1",
"process" : "mongod",
"uptime" : 3319,
"uptimeEstimate" : 3285,
"localTime" : ISODate("2011-07-28T21:58:08.918Z"),
"globalLock" : {
"totalTime" : 3319046531,
"lockTime" : 11182085,
"ratio" : 0.003369065451646722,
"currentQueue" : {
"total" : 0,
"readers" : 0,
"writers" : 0
},
"activeClients" : {
"total" : 0,
"readers" : 0,