Ganglia API安装与使用

Ganglia监控本身没有提供API可供外部程序调用,只是依据ganglia监控的原理,能够通过分析gmetad的port的xml来直接获取metrics。


Guardian已经在Github上公布了这样一套python程序。能够直接在通过restful API来查询metric。


https://github.com/guardian/ganglia-api
安装需求:
virtualenv
tornado
python2.6以上
ganlgia API是一个独立程序。能够安装在任何位置
将ganglia-api.py文件里的import settings改成import dev_settings
启动
virtualenv ve
source ve/bin/activate
python ganglia/ganglia_api.py

注意:
1./etc/ganglia/gmetad-*-*.conf这个文件必需要有。*能够用其它字符替代
2.tornado安装须要依赖包:
backports.ssl_match_hostname
certifi
其它使用和安装说明请直接參考Github或源码中的README.md

原文地址:https://www.cnblogs.com/yjbjingcha/p/6908239.html