This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

Install PyMongo with C Extensions


If you installed PyMongo without the C extensions (i.e. on a system without a C compiler, or not using the Windows installer), PyMongo should be re-installed with C extensions.

While the C extensions are not required for MMS Monitoring, they significantly improve performance. You must have a C compiler (e.g. gcc) and Python header files installed on your system.


Before you install the PyMongo C extensions, these software packages must be available or installed on the target system:

  • Python 2.6+
  • pymongo to install the Python driver used by the monitoring agent
  • to install the MongoDB monitoring agent
  • gcc or similar to install a C compiler
  • pip to install and uninstall PyMongo
  • For Debian and Ubuntu: python-dev to install Python C extensions
  • For Red Hat, CentOS, and Fedora: python-devel, python-setuptools, and python-setuptools-devel to install Python C extensions



Install gcc and Python Packages

For Debian and Ubuntu environments, issue this command:

sudo apt-get install build-essential python-dev

For Red Hat, CentOS, and Fedora environments, issue this command:

sudo yum install gcc python-devel python-setuptools python-setuptools-devel

Install the pip Utility

sudo easy_install pip

Remove PyMongo

sudo pip uninstall pymongo

Re-Install PyMongo

sudo pip install pymongo

Restart Monitoring Agent

cd mms-agent
nohup python > /LOG_DIRECTORY/agent.log 2>&1 &

Replace LOG-DIRECTORY with the path to your MongoDB logs.

When you restart your agent there is a 5 minute timeout before the agent will begin sending data to MMS again.

Next Steps

Once the agent is running and configured, the next step is to deploy the monitoring agent in production.

Also, consider reading the PyMongo documentation.