Bobcares

MongoDB Munin plugin – A smart way for monitoring servers

by | Nov 16, 2019

The monitoring of MongoDB servers comes handy with solutions like MongoDB Munin plugin.

Installing the Munin plugin is quite easy. However, problems with user permissions or wrong paths often create errors during installation.

At Bobcares, we often get requests from our customers to install MongoDB Munin plugin as part of our Server Management Services.

Today, let’s get into the details on how our Support Engineers install Munin plugin and fix the related errors.

 

How we install MongoDB Munin Plugin

The Munin plugin can be installed on each node where MongoDB runs. Normally, this Munin Plugin works with only MongoDB 2.4 or above versions.

Also, it provides the monitoring of the following values.

  1. B-Tree stats
  2. Current connections
  3. Memory usage
  4. Database operations

Now, let’s see how our Support Engineers integrate Munin Plugin with  MongoDB.

In Red Hat and CentOS, we use the following steps.

1. Initially, we enable the EPEL Repository.

yum -y install epel-releaseCopy Code

2. Then, we install pymongo which is required to install the Munin Plugin.

yum install pymongoCopy Code

3. Next, we install the plugin with the following command.

git clone https://github.com/comerford/mongo-munin.git /tmp/mongo-munin
cp /tmp/mongo-munin/mongo_* /usr/share/munin/plugins
ln -sf /usr/share/munin/plugins/mongo_btree /etc/munin/plugins/mongo_btree
ln -sf /usr/share/munin/plugins/mongo_conn /etc/munin/plugins/mongo_conn
ln -sf /usr/share/munin/plugins/mongo_lock /etc/munin/plugins/mongo_lock
ln -sf /usr/share/munin/plugins/mongo_mem /etc/munin/plugins/mongo_mem
ln -sf /usr/share/munin/plugins/mongo_ops /etc/munin/plugins/mongo_ops
ln -sf /usr/share/munin/plugins/mongo_docs /etc/munin/plugins/mongo_docs
chmod +x /usr/share/munin/plugins/mongo_*Copy Code

Then we restart the munin-node.

service munin-node restartCopy Code

4. Then we configure the custom db connection as follows.

We open /etc/munin/plugin-conf.d/munin-node and set env value in it.

[mongo_*]
env.MONGO_DB_URI mongodb://user:password@host:port/dbnameCopy Code

 

That’s it. This is how we install the Munin Plugin.

After installing the plugin, we use the following command to force the server to update the information. This helps us to check whether the setup is correct or not.

sudo -u munin /usr/share/munin/munin-updateCopy Code

If everything is set up correctly, the output looks like,

 

 

How we fixed the errors while installing Munin for MongoDB

At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers facing problems while installing Munin on the server.

Now, let’s see the major reasons for installation errors and how our Support Engineers fix this error.

 

1. Wrong directory

Recently, one of our customers had a problem with the Munin installation. He installed Munin and munin-node on the monitoring server and munin-node on the MongoDB server. But, the MongoDB plugins weren’t showing on the monitoring server. Also, when he trying to run plugins directly on the mongo server “python /usr/share/munin/plugins/mongo_btree” it returned the output, but nothing showed on the monitoring server.

On checking, our Support Engineers found that the plugin was installed in the wrong folder. So, we copied the plugin files to /usr/share/munin/plugins

cp mongo_*  /usr/share/munin/pluginsCopy Code

Also, we created the correct links to /etc/munin/plugins folder.

Finally, we restarted the munin-node.

/etc/init.d/munin-node restartCopy Code

This fixed the error.

 

2. Permission errors

Similarly, wrong permissions also create problems with the Munin plugin. Here, the installation will run smoothly. However, plugin will not be able to connect to the MongoDB instance due to permission issues.

On checking, our Support Engineers found that the user didn’t have enough permission to run the Munin plugin on the server.  So, we had to tweak the permission of the Munin user and that solved the error.

 

[Need assistance to install Munin plugin? We’ll help you.]

 

Conclusion

In short, problems with user permission and wrong directory create errors while installing MongoDB Munin plugin. Today, we saw how our Support Engineers assisted our customers to install the Munin plugin and solved the error.

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Speed issues driving customers away?
We’ve got your back!