{ "info": { "author": "Dave Carroll", "author_email": "davecarrollno@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: System :: Monitoring" ], "description": "GangliaRest\n===========\n\n|PyPI version|\n\nOverview\n--------\n\nHTTP API frontend for Ganglia Web - Expose your Ganglia metrics via HTTP.\n\nGangliaRest is a 100% open-source package layered on top of your Ganglia Web host.\nWe use it to expose metrics collected from nodes to our Nagios monitoring station \nor from various scripts for whatever purpose. I am aware of the project to expose\nGanglia metrics to Nagios but that didn't fit our needs, especially given we have\nsuch a large Ganglia implementation. I chose instead to write this front end so we \ncould pick our metrics and develop Nagios monitoring around those.\n\nOur Nagios server simply makes properly formatted API requests to GangliaRest and acts\nupon the result. I initially returned formatted json responses and had Nagios use a \ncustom API client but over time we decided keeping things straightforward was best.\n\nI use Redis to cache the locations for nodes in the RRDtree so metric lookups\nare more efficient. (we have hundreds of nodes we trend) A configurable threaded\nIndexer will prime and keep the Redis cache healthy.\n\nWith GangliaRest, one can expose metrics without reading the XML stream, create\non-demand monitoring integrate something like Nagios, or create cluster manager \nsoftware that uses Ganglia metrics for various purposes. \n\n\nCore Requirements\n-----------------\n- Python 2.6 or Python 2.7 (as tested)\n- Python webpy\n- Python Redis client\n- gns3_netifaces-0.10.4.1\n- Redis Server > 2.8 (available from Atomic CentOS) \n- Ganglia Gmetad Web hosting your rrdtree\n\n\nInstallation\n------------\nThis package is currently running on CentOS 6.8 with Python 2.6. You may need to groupinstall\nthe \"Development tools\" as well as the python-devel package. Once you are ready to install\nGangliaRest you can run pip install gangliarest as root. \n\nThe module will be installed into /usr/lib/python2.x/site-packages/gangliarest. \nThe configuration file will be installed as /etc/GangliaRest.cfg\nThe init script will be installed as /etc/init.d/GangliaRest\n\nYou will want to adjust /etc/init.d/GangliaRest if you run Redis on a different port\nYou will want to chkconfig add GangliaRest to start at run level 3.\nYou will want to adjust your iptables accordingly.\nYou will want to visit /etc/GangliaRest.cfg and adjust your config file.\n\nYou will want to install a local Redis server. You can add the atomic repo\nby running: wget -O - http://www.atomicorp.com/installers/atomic |sh\nfollowed by: yum install redis which should net you a version better than 2.8.\n\nEdit your /etc/redis.conf file and set the requirepass to a password you prefer.\n\nRun service redis start and chkconfig that accordingly. \n\nRun service GangliaRest start when you are ready. A pid file will be dropped in as\n/var/run/GangliaRest.pid. You will receive a warning if a valid Redis pidfile was not\ndetected in /var/run/redis/redis.pid. If you run multiple Redis instances, adjust \naccordingly. \n\nGangliaRest should now be listening on port 8653 or whatever you selected in \n/etc/GangliaRest.cfg. \n\nUpgrading\n---------\nGangliaRest will check on startup and once per day for any available upgrades.\nThese may include important bug fixes or enhancements so please consider upgrading\nwhen you see a message in the logfile informing you of an upgrade. \n\nTo upgrade run the following commands:\nsystem# service GangliaRest stop\nsystem# pip install gangliarest --upgrade \n\nThe upgrader will copy your /etc/GangliaRest.cfg file as GangliaRest.cfg.save so you \nwill not lose your changes. You can then merge those changes into the newly created \nGangliaRest.cfg file.\n\n\nUsage\n-----\nOnce running, you can send HTTP requests against GangliaRest using a URL formatted\nas: http://:8653/node//get_metric/\n\nFor example, if my Gmeta Web Host is named gweb.example.com and I wanted to view the \nload_one metric for my node named web1.example.com I would format my request as:\nhttp://gweb.example.com:8653/node/web1.example.com/get_metric/load_one \n\nGangliaRest will search your RRDtree for the node web1, locate the metric rrd for load_one,\nand return the current metric value. For each request, the location on the filesystem for\nthat node will be cached in Redis for faster future lookups to save filesystem scanning. \n\nIndexer\n-------\nThe indexer will run scanning your RRDtree for the purpose of caching filesystem locations\non a configurable basis. If it has not been run, it will prime the cache by running at start up \nand you will see logged entries such as:\n\n2016-12-22 10:36:32,999 - root - DEBUG Thread-140068063868672 - INFO: INDEXER: Running Indexer for first time\n2016-12-22 10:36:33,000 - root - DEBUG Thread-140068063868672 - INFO: INDEXER starting scheduled operations...\n2016-12-22 10:36:33,017 - root - DEBUG Thread-140068063868672 - INFO: INDEXER completed run...Added 14 entries to Redis\n\nThe above indicates the indexer ran and added 14 nodes to the cache. \n\n\nRedis\n-----\nOnce you have redis installed and have set the password both in /etc/GangliaRest and in\n/etc/redis.conf, you can connect to Redis to examine the cached nodes that were indexed. \nTo do this:\n\nroot@gweb# redis-cli -a \n127.0.0.1:6379> select 1 # select DB instance 1 \nOK\n127.0.0.1:6379> keys * # list all nodes by key\n1) \"web1\"\n2) \"app1.example.com\"\n\n\nGangliaRest.cfg - Configuration\n-------------------------------\nLocated in /etc, the GangliaRest.cfg file offers some options to control the behavior of\nGangliaRest to suit your needs. The following options are included:\n\n- restHost: This option defines where GangliaRest will listen. You can leave the default\nof 0.0.0.0 to listen on all interfaces, or specify perhaps just your internal IP.\n\n- restPort: This option defines the port GangliaRest will listen on. The default is 8653. \nRemember to adjust your iptables accordingly. \n\n- logfile: This defines where you want GangliaRest activity logged to. There are many\nuseful log messages so it is recommended you review this. \n\n- logLevel: This is a future option on the TODO list to control the level of logging.\n\n- statsFile: This option controls where you want stats printed out to. I send mine to\n/tmp/gangliaRest.state and have a Ganglia Python DSO that reads those metrics, graphing\nthe number of requests/responses and errors per minute. \n\n- domain: You must adjust this to your domain. GangliaRest uses the defined domain to\nprocess information it needs. Many times nodes may be created by Ganglia Gmetad using\neither a hostname alone or fqdn, depending upon your setup. In cases where both are used\nGangliaRest needs to search the filesystem for node matches to service API requests. \n\n- rrdDir: Set this to where your rrd files are. The default is /var/lib/ganglia/rrds.\n\n- redisHost: This defines where your Redis server is. Localhost is the default.\n\n- redisPort: This defines the port your Redis server is listening on. 6379 is the default.\n\n- redisDb: This defines a DB instance. Some folks run multiple DBs per Redis instance while \nothers run multiple Redis servers with one db each. \n\n- redisTtl: This option controls the expiration in Redis of your node locations. The recommended\nsetting is one day or 86400. This means nodes will be indexed by the indexer and held in cache\nfor one day. This is probably good for most orgs and allows expiring out nodes no longer in use\nafter one day.\n\n- redisAuth: This defines your Redis requireauth option as defined in /etc/redis.conf. \n\n- indexFreq: This option controls how often in seconds the GangliaRest Indexer will run. The Indexer\nscans your RRDtree and catalogs node locations into Redis for fast lookups. The default is 3600 \nseconds, or hourly. If you do not add new nodes to Ganglia often, you can set this higher but one\nhour is recommended. If you add dynamic nodes often, you migth even set this to 300 seconds to \nbe more aggressive. \n\nLogging\n-------\nGangliaRest will log output on certain operations to /var/log/GangliaRest.log. You should add this\nto your logrotate jobs accordingly. The log will show API requests, responses and errors. These are\nincremented by a counter and sent to a file defined in GangliaRest.cfg in a simple format. From there,\nyou can create a Ganglia DSO or script job to pick those stats up and have them graphed. This will show\nhow busy your GangliaRest server is. You can also parse the logfile for information if that meets \nyour needs better.\n\nThe logfile will show errors and failures. When a request is received for a non-existent node or \nthe API request is misconfigured, a simple NOT FOUND error will be displayed (easy for scripts \nor Nagios checks to parse) and an incident will be logged. \n\nThe Indexer will also log its operations. The indexer checks every 60 seconds to see whether\nit needs to run an indexing operation, as configured by your indexFreq setting. The Indexer will\nlog whether it needs to run or go back to sleep. \n\nUpon start of GangliaRest a software update check is performed and notiifcation is logged if there\nis a more recent update available. One may upgrade using: pip install gangliarest --upgrade. A \nlogged message during the check appears as:\n\n2016-12-22 10:36:32,996 - root - DEBUG Thread-140068300097280 - Notice: The installed version of gangliarest is 0.1.6\n\nWhen an update has been detected at Pypi, a logged message will appear as:\n\n2016-12-22 10:33:00,582 - root - DEBUG Thread-140338108651264 - NOTICE: gangliarest-0.18 is available. Run 'pip install gangliarest --upgrade' to get the latest.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/dcarrollno/Ganglia-Modules/tree/master/GangliaRest", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dcarrollno/Ganglia-Modules/wiki/GangliaRest-API:-Part-I", "keywords": "Ganglia API REST Web frontend metrics", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "gangliarest", "package_url": "https://pypi.org/project/gangliarest/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gangliarest/", "project_urls": { "Download": "https://github.com/dcarrollno/Ganglia-Modules/tree/master/GangliaRest", "Homepage": "https://github.com/dcarrollno/Ganglia-Modules/wiki/GangliaRest-API:-Part-I" }, "release_url": "https://pypi.org/project/gangliarest/0.1.12/", "requires_dist": null, "requires_python": null, "summary": "A ReSTFUL frontend to Ganglia exposing metrics via HTTP.", "version": "0.1.12" }, "last_serial": 2551793, "releases": { "0.1.10": [ { "comment_text": "", "digests": { "md5": "7b24847b7a3c08e81af93509182fd68c", "sha256": "9044e991e080476548583023f70f43fc6b3db4f69147c48b72687d4c4ca54489" }, "downloads": -1, "filename": "gangliarest-0.1.10.tar.gz", "has_sig": false, "md5_digest": "7b24847b7a3c08e81af93509182fd68c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21283, "upload_time": "2016-12-24T18:35:46", "url": "https://files.pythonhosted.org/packages/a2/80/cbbe41ba0f720d2f2b07b22dabfcdbfbf23cf41e4c38738ffabc75540148/gangliarest-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "7e2d6765e152acb1afe492c2ddf75b0c", "sha256": "c2b7a9e89f016eaf66f2b4a0e2875b16b0d4e6e2a1f129dcb5fc904c9b2e846e" }, "downloads": -1, "filename": "gangliarest-0.1.11.tar.gz", "has_sig": false, "md5_digest": "7e2d6765e152acb1afe492c2ddf75b0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21466, "upload_time": "2017-01-02T14:58:18", "url": "https://files.pythonhosted.org/packages/4b/ad/7025dccd1548b6a54f1b45c4aaaa94911be59a590f9eadf94f11e576620d/gangliarest-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "2e982431afb063931244e64a684d7d37", "sha256": "3d2f36443ae354b44972c88928baee3710309840fb070b81d990228b6f924e39" }, "downloads": -1, "filename": "gangliarest-0.1.12.tar.gz", "has_sig": false, "md5_digest": "2e982431afb063931244e64a684d7d37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21718, "upload_time": "2017-01-03T15:37:50", "url": "https://files.pythonhosted.org/packages/1f/1d/6774d1e1445063c2158d96ea90b40f56eb2f16d68fd31120690010b67db7/gangliarest-0.1.12.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "c8e71d3e03b58829d5a608df5b297d66", "sha256": "9b76ef934728ca8056e6db4444764e3a7c1c93384768fa7aa064f34b9c288f69" }, "downloads": -1, "filename": "gangliarest-0.1.4.tar.gz", "has_sig": false, "md5_digest": "c8e71d3e03b58829d5a608df5b297d66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16341, "upload_time": "2016-12-22T00:47:53", "url": "https://files.pythonhosted.org/packages/49/d6/0ff106a894a8ca7dcd61ece1ebb7a6345fc9025662b1ef4e33bffe780f15/gangliarest-0.1.4.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "79143c5877b85203ae2e094a0387caa1", "sha256": "a85c66dc3d1946849250d7d845c92debbff5d5315359fe1fa86fd561dd80dd73" }, "downloads": -1, "filename": "gangliarest-0.1.6.tar.gz", "has_sig": false, "md5_digest": "79143c5877b85203ae2e094a0387caa1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16531, "upload_time": "2016-12-22T04:01:19", "url": "https://files.pythonhosted.org/packages/7f/14/f56dac8bd04237dfa0f68e4253ab2fd26368c65ce09cb05937ba3ae457d8/gangliarest-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "3eea83c2adce4433ad7372a34212d6a4", "sha256": "3809817b9df67f82212a4e84a6d59cdde4c435a35bd0b36636ecbcb3c83dd21e" }, "downloads": -1, "filename": "gangliarest-0.1.7.tar.gz", "has_sig": false, "md5_digest": "3eea83c2adce4433ad7372a34212d6a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19124, "upload_time": "2016-12-22T17:27:54", "url": "https://files.pythonhosted.org/packages/53/e0/78e97d0bc030c2ff899db822b3cb7dd858ddf387c0fdf9feda4b091d0e9d/gangliarest-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "c42f3c47d2b4b6d617d4cfff20f09456", "sha256": "e8ccb16a984888f091516d93fb6d61285a8dc50a2766aaf1f4595113ce8cd67e" }, "downloads": -1, "filename": "gangliarest-0.1.8.tar.gz", "has_sig": false, "md5_digest": "c42f3c47d2b4b6d617d4cfff20f09456", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19135, "upload_time": "2016-12-22T17:41:39", "url": "https://files.pythonhosted.org/packages/fc/b7/4a04971e59bbd70d2ecb3c704c6b87094518d8b5b9333acd533476bacb7f/gangliarest-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "9b3cf569a7c2aa2e4f6b009558f5827b", "sha256": "a6241c9a76748387fed289b3caa7832884685ea45bd86bce1f03ac55b73342a8" }, "downloads": -1, "filename": "gangliarest-0.1.9.tar.gz", "has_sig": false, "md5_digest": "9b3cf569a7c2aa2e4f6b009558f5827b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19791, "upload_time": "2016-12-22T19:39:57", "url": "https://files.pythonhosted.org/packages/3e/d6/da9a20cc8514de8362781dc7ba3d62e53c5f456717690a3d3906bbd71155/gangliarest-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e982431afb063931244e64a684d7d37", "sha256": "3d2f36443ae354b44972c88928baee3710309840fb070b81d990228b6f924e39" }, "downloads": -1, "filename": "gangliarest-0.1.12.tar.gz", "has_sig": false, "md5_digest": "2e982431afb063931244e64a684d7d37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21718, "upload_time": "2017-01-03T15:37:50", "url": "https://files.pythonhosted.org/packages/1f/1d/6774d1e1445063c2158d96ea90b40f56eb2f16d68fd31120690010b67db7/gangliarest-0.1.12.tar.gz" } ] }