racker/rackspace-monitoring-agent-plugins-contrib — pull request #33 by vickleford (2013-09-24 19:35:13+00:00)
Title: ElasticSearch Plugin

Add an elasticsearch module, but because of the 10 metric limit, break it into 6 different types based on mutually exclusive arguments passed.

* --cluster-health shows general cluster status from /_cluster/health
* --stats-store shows local node metrics about storing from /_cluster/nodes/_local/stats
* --stats-index shows local node metrics about indexes from /_cluster/nodes/_local/stats
* --stats-get shows local node metrics about gets from /_cluster/nodes/_local/stats
* --stats-search shows local node metrics about searches from /_cluster/nodes/_local/stats
* --stats-docs shows local node metrics about docs from /_cluster/nodes/_local/stats

Examples:
aluminum13:rackspace-monitoring-agent-plugins-contrib$ pep8 elasticsearch.py
aluminum13:rackspace-monitoring-agent-plugins-contrib$ ./elasticsearch.py --stats-docs
status Elasticsearch returned a response
metric count uint64 0
metric deleted uint32 0
aluminum13:rackspace-monitoring-agent-plugins-contrib$ ./elasticsearch.py -H 'noesclusterhere.com' --stats-docs
status unknown url type: noesclusterhere.com/_cluster/nodes/_local/stats
aluminum13:rackspace-monitoring-agent-plugins-contrib$ ./elasticsearch.py -H 'http://127.0.0.1:9200' --cluster-health
status Elasticsearch returned a response
metric status string green
metric number_of_nodes uint32 3
metric unassigned_shards uint32 0
metric timed_out string False
metric active_primary_shards uint32 15
metric cluster_name string actionlogs_index
metric relocating_shards uint32 0
metric active_shards uint32 30
metric initializing_shards uint32 0
metric number_of_data_nodes uint32 3
aluminum13:rackspace-monitoring-agent-plugins-contrib$

This was tested on elasticsearch-0.90.5 installed on RHEL6.