Search

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example code for monitoring ElasticSerach status

Code Block
#!/usr/bin/python

import urllib2, json

#url='http://localhost:9200/_nodes/hipchat.home.soenke-martens.de/stats'
url='http://localhost:9200/_nodes/thread_pool'

req = urllib2.Request(url)
opener = urllib2.build_opener()
f = opener.open(req)
j = json.loads(f.read())
#print json
print json.dumps(j, indent=4, sort_keys=True)
#print json['nodes']['-koYKPKhSRGgcNrmIKN3-Q']['thread_pool']

...