{ "info": { "author": "Markus Juenemann", "author_email": "markus@juenemann.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Monitoring" ], "description": "Nomit\n=====\n\nNomit is a small library that can be used to process HTTP/XML POST\nrequests from Monit_ instances. While it is a relatively trivial adaption\nof Python's `BaseHTTPRequestHandler`_, it may be useful to multiple \nother projects. For this reason Nomit is registered as its own little\nproject.\n\nMonit_ is a free utility for managing Unix systems. Multiple Monit \ninstances can be centrally managed by its sister project MMonit. \nMonit communicates with MMonit through HTTP/XML POST request.\n\nRequirements\n------------\n\nNomit uses the `lxml.objectify` module from the lxml_ project. Many Linux\ndistributions provide lxml_ in their native package format.\n\nThe `MonitHandler` class\n------------------------\n\nNomit provides a single class `MonitHandler` which is a sub-class of\n`BaseHTTPRequestHandler`_. `MonitHandler` is meant to be sub-classed\nitself. \n\nIt provides two methods:\n\n- `handle_unparsed()` is called with the raw XML of the HTTP/XML POST request.\n- `handle_parsed()` is called after the XML has been parsed by `lxml.objectify.fromstring()`.\n\nThe default implementation of these methods does nothing. Any derived class must\nimplement these methods as necessary.\n\nExample\n--------\n\nThe example below implements `handle_unparsed()` to print the raw XML as\nPOSTed by the Monit agent and uses `handle_parsed()` to display the data\nstructure returned by `lxml.objectify.fromstring()`::\n\n import BaseHTTPServer\n import xml.dom.minidom\n import lxml.objectify\n import nomit\n\n class ExampleHandler(nomit.MonitXmlHandler):\n def handle_unparsed(self, s):\n print xml.dom.minidom.parseString(s).toprettyxml()\n \n def handle_parsed(self, o):\n print lxml.objectify.dump(o)\n \n server = BaseHTTPServer.HTTPServer((\"127.0.0.1\", 2811), ExampleHandler)\n server.serve_forever()\n\nMonit configuration\n-------------------\n\nThe Monit agent must be told to POST status information to the Python\nscript above. From the agent's point of view the script is simply (another[1]_)\nMMonit server. \n\n``monit.conf``:: \n\n set mmonit http://monit:monit@mmonit.example.com:8080/collector \n http://localhost:2811/\n \n \n_[1] The ``set mmonit`` directive accepts multiple URLs.\n\n.. _Monit: http://mmonit.com/monit/\n.. _MMonit: http://mmonit.com/monit/#mmonit\n.. _`BaseHTTPRequestHandler`: https://docs.python.org/2/library/basehttpserver.html\n.. _lxml: http://lxml.de/", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/mjuenema/nomit/tarball/1.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mjuenema/nomit", "keywords": "xml,Monit,MMonit", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "nomit", "package_url": "https://pypi.org/project/nomit/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/nomit/", "project_urls": { "Download": "https://github.com/mjuenema/nomit/tarball/1.0", "Homepage": "https://github.com/mjuenema/nomit" }, "release_url": "https://pypi.org/project/nomit/1.0/", "requires_dist": null, "requires_python": null, "summary": "Process Monit HTTP/XML", "version": "1.0" }, "last_serial": 1065217, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "a38d71fc14a5c113f594abdf3a88a826", "sha256": "61724841c602cd6e5aa327fa768824d5d5f1bbb127247383b32d67cfbb67c8fe" }, "downloads": -1, "filename": "nomit-1.0.tar.gz", "has_sig": false, "md5_digest": "a38d71fc14a5c113f594abdf3a88a826", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3691, "upload_time": "2014-04-19T13:08:58", "url": "https://files.pythonhosted.org/packages/da/46/a9a940d47d56a820974db7f2b6f9bc702c5826b42560f9e59c4a21fdae85/nomit-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a38d71fc14a5c113f594abdf3a88a826", "sha256": "61724841c602cd6e5aa327fa768824d5d5f1bbb127247383b32d67cfbb67c8fe" }, "downloads": -1, "filename": "nomit-1.0.tar.gz", "has_sig": false, "md5_digest": "a38d71fc14a5c113f594abdf3a88a826", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3691, "upload_time": "2014-04-19T13:08:58", "url": "https://files.pythonhosted.org/packages/da/46/a9a940d47d56a820974db7f2b6f9bc702c5826b42560f9e59c4a21fdae85/nomit-1.0.tar.gz" } ] }