En este repositorio encontrarás soluciones a monitoreos de Zabbix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

solr-pypoll.py 517B

  1. #!/usr/bin/python
  2. # -*- encoding: utf-8 -*-
  3. import urllib
  4. import xml.etree.ElementTree as ET
  5. import json
  6. fqdn = 'http://127.0.0.1:8983/'
  7. uri = 'solr/admin/cores?action=STATUS'
  8. def main():
  9. data = []
  10. resp=urllib.urlopen(fqdn+uri).read()
  11. tree = ET.fromstring(resp)
  12. for lst in tree.findall("lst"):
  13. for lst2 in lst.findall("lst"):
  14. core={"{#CORENAME}":lst2.attrib['name']}
  15. data.append(core)
  16. print json.dumps({"data": data})
  17. if __name__ == "__main__":
  18. main()