Created
July 11, 2014 15:50
-
-
Save AMeng/3f7a89a0f7888569d8a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
import urllib2 | |
url = 'http://192.168.3.14:9200/_cluster/health?pretty=true' | |
results = urllib2.urlopen(url).read() | |
stats = json.loads(results) | |
print "metric cluster_status string {0}".format(stats['status']) | |
print "metric number_of_nodes int {0}".format(stats['number_of_nodes']) | |
print "metric active_shards int {0}".format(stats['active_shards']) | |
print "metric relocating_shards int {0}".format(stats['relocating_shards']) | |
print "metric initializing_shards int {0}".format(stats['initializing_shards']) | |
print "metric unassigned_shards int {0}".format(stats['unassigned_shards']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment