1. Add the python extension of gmond (taking MongoDB as an example)
Check/usr/local/ganglia/lib/ganglia/modpython. so. If it does not exist, you may not have Python installed before compiling and installing ganglia, or you have not specified the python directory. You can try ganglia/gmond/modules/Python/Under the compiling directory /. libs/modpython. so to the above directory.
# Install the python measurement module of gmond, which can be RPM installation (anglia-gmond-modules-python-3.1.1-1.i386.rpm) or manual installation, I use manual installation.
# Add gmond-Python extension Library
Sudo mkdir/etc/ganglia/CONF. d
Sudo mkdir/usr/local/ganglia/lib/ganglia/python_modules
Sudo CP ~ /Downloads/ganglia-3.1.2/gmond/modules/CONF. d/modpython. CONF/etc/ganglia/CONF. d/
[Sudo CP ~ /Downloads/ganglia-3.1.2/gmond/modules/Python/. libs/modpython. So/usr/local/ganglia/lib/ganglia/] (If the compilation and installation are unsuccessful, you can try it and it has not been verified. There is another question: Do I have to copy files like modpython. La.?)
# Check whether the python module is mounted
/Usr/local/ganglia/sbin/gmond-D10
# Download the gmond-Python extension monitoring package
Cd ~ /Downloads
Wget https://download.github.com/ganglia-gmond_python_modules-c1e3a5d.tar.gz
# Gmond extensions for various products are available here. We use MongoDB extensions.
Tar-zxvf ganglia-gmond_python_modules-c1e3a5d.tar.gz
CD ganglia-gmond_python_modules-c1e3a5d/MongoDB
# Copy ExtensionProgramAnd configuration file
Sudo CP python_modules/MongoDB. py/usr/local/ganglia/lib/ganglia/python_modules/
Sudo CP Conf. d/MongoDB. CONF/etc/ganglia/CONF. d/MongoDB. pyconf
# Modify MongoDB. pyconf
Set Value = "mongo -- quiet -- eval 'printjson (db. serverstatus ())'"
And value = "mongo -- quiet -- eval 'printjson (Rs. Status ())'"
Replace Mongo with the absolute path of the file. Of course, you do not need to modify MongoDB. pyconf to ensure that MongoDB/bin can be in the PATH environment variable.
#Check whether custom extensions can be mounted
/Usr/local/ganglia/sbin/gmond-m
# Restart the service and view the results in a browser
Sudo service gmond restart
Sudo service gmetad restart
Sudo/usr/local/apache2/bin/apachectl restart