程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Ganglia python metric extension

編輯:Python

1 Install Ganglia

Ganglia installation and deployment process

2 Download the modpython.so dynamic library (if you have modpython.so, you can skip this step)

yum -y install ganglia-gmond-python

3 Configure your own extended metric

The official provides some metrics that can be modified and used directly:
https://github.com/ganglia/gmond_python_modules

① Modify the configuration file and add extended modules

vim /etc/ganglia/gmond.conf
modules {...module {name = "sys_module" ##Note that the name should correspondpath = "modsys.so"}/* Add python main module */module {name = "python_module"/* Dynamic library path, the full path is $GANGLIA_ROOT/lib64/ganglia/modpython.so */path = "modpython.so"/* Python extension module code storage directory, if it does not exist, create it */params="/etc/ganglia/python_modules/"}}include ('/etc/ganglia/conf.d/*.conf') /* /etc/ganglia/conf.d/ is the storage directory for the configuration file of the python extension module. If it does not exist, create it. When gmond starts, it will load all configuration files and python module code*/include ('/etc/ganglia/conf.d/*.pyconf') ... 

② Write extension module Python code and configuration file

Extension module configuration file storage location

/etc/ganglia/conf.d/xxx.pyconf

Extension module python code storage location

/usr/lib64/ganglia/python_modules/xxx.py

3 Restart service

systemctl restart gmond.service

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved