- On Prem MMS Monitoring >
- Getting Started with On Prem MMS Monitoring >
- Install Monitoring Agent >
- Build PyMongo Packages with PyMongo C Extensions
Build PyMongo Packages with PyMongo C Extensions¶
Overview¶
If you are installing PyMongo and the Monitoring agent on systems that do not
have C compilers, you can create a .egg
package of PyMongo with C
extensions to install on your system or systems.
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.
Prerequisites¶
Before you build PyMongo packages with PyMongo C extensions, these software packages must be available or installed on the target system:
- Python 2.6+
curl
to retrieve PyMongo archived filegcc
or similar to install a C compilerpython-dev
orpython-devel
to install Python C extensionspip
to install and uninstall PyMongopymongo
to install the Python driver used by the monitoring agentagent.py
to install the MongoDB monitoring agent
The packages distributed in PyPI for Windows include C extensions.
Considerations¶
The .egg
file created with these instructions will only work on systems that
resemble the environment on which you built the package. Ensure operating
systems, versions of Python, and architecture (i.e. “32” or “64” bit) match.
Commands below use PyMongo version 2.6.3. If the current version is higher, replace 2.6.3 with the current number.
Procedure¶
Install gcc and Python Packages¶
For Debian and Ubuntu environments, issue this command:
For Red Hat, CentOS, and Fedora environments, issue this command:
Install PyMongo¶
Extract the PyMongo Files¶
Build the .egg
File¶
Once built, you can find .egg
file in the dist/ sub-directory. The file
name will resemble pymongo-2.6.3-py2.7-linux-x86_64.egg
but may have a
different name depending on your platform and the version of python you use to
compile.
Install the .egg
File on Target System¶
Install the Monitoring Agent¶
Copy the .egg
file to the target system and issue this command to install the package:
Replace LOG-DIRECTORY
with the path to your MongoDB logs.
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.