Metadata-Version: 1.1
Name: apache-manager
Version: 1.2
Summary: Monitor and control Apache web server workers from Python
Home-page: https://apache-manager.readthedocs.io
Author: Peter Odding
Author-email: peter@peterodding.com
License: MIT
Description: apache-manager: Monitor and control Apache web server workers from Python
        =========================================================================
        
        .. image:: https://travis-ci.org/xolox/python-apache-manager.svg?branch=master
           :target: https://travis-ci.org/xolox/python-apache-manager
        
        .. image:: https://coveralls.io/repos/xolox/python-apache-manager/badge.svg?branch=master
           :target: https://coveralls.io/r/xolox/python-apache-manager?branch=master
        
        The `apache-manager` package helps to collect monitoring metrics_ about the
        `Apache web server`_ and kill worker processes that exceed resource thresholds.
        It works by parsing the plain text and HTML status pages generated by Apache's
        mod_status_ module. It's currently tested on Python 2.6, 2.7, 3.4, 3.5, 3.6,
        3.7 and PyPy.
        
        .. contents::
           :local:
        
        Status
        ------
        
        On the one hand the `apache-manager` package was developed based on quite a few
        years of experience interfacing with (and monitoring) the `Apache web server`_
        using the interfaces provided by Apache itself (mod_status_) as well as the
        Linux operating system interfaces (``/proc``).
        
        On the other hand the Python package itself is quite new: it was developed
        between June and September of 2015.
        
        Then again, I'm religious about test coverage, so there's that :-).
        
        Despite the complete package being covered by automated tests I'm not (yet)
        committing to backwards compatibility because I first want to run this package
        in a production (like) environment for some time, to get a feeling for how
        robust it is. I also need to evaluate how easy it is to integrate the current
        solution into monitoring systems (that was a goal, but I don't always achieve
        my goals on the first attempt :-).
        
        Installation
        ------------
        
        The `apache-manager` package is available on PyPI_ which means installation
        should be as simple as:
        
        .. code-block:: sh
        
           $ pip install apache-manager
        
        There's actually a multitude of ways to install Python packages (e.g. the `per
        user site-packages directory`_, `virtual environments`_ or just installing
        system wide) and I have no intention of getting into that discussion here, so
        if this intimidates you then read up on your options before returning to these
        instructions ;-).
        
        Usage
        -----
        
        There are two ways to use the `apache-manager` package: As the command line
        program ``apache-manager`` and as a Python API. For details about the Python
        API please refer to the API documentation available on `Read the Docs`_. The
        command line interface is described below.
        
        Command line
        ~~~~~~~~~~~~
        
        .. A DRY solution to avoid duplication of the `apache-manager --help' text:
        ..
        .. [[[cog
        .. from humanfriendly.usage import inject_usage
        .. inject_usage('apache_manager.cli')
        .. ]]]
        
        **Usage:** `apache-manager [OPTIONS]`
        
        Command line interface to monitor the Apache web server and kill worker
        processes that exceed resource thresholds. When no options are given the
        server metrics and memory usage of workers are printed to the terminal.
        
        **Supported options:**
        
        .. csv-table::
           :header: Option, Description
           :widths: 30, 70
        
        
           "``-w``, ``--watch``","This option causes the Apache manager to redraw the collected metrics once
           every 10 seconds in a ""top"" like interface until interrupted using ""q"" (for
           quite) or Control-C."
           "``-a``, ``--max-memory-active=SIZE``","Kill active Apache workers that are using more memory than specified by the
           ``SIZE`` argument. ``SIZE`` is expected to be a human readable memory size like 50K
           (50 kilobytes), 42M (42 megabytes), 2G (2 gigabytes), etc."
           "``-i``, ``--max-memory-idle=SIZE``","Kill Apache workers that are using more memory than specified by the ``SIZE``
           argument (see ``--max-memory-active`` for acceptable values of ``SIZE``)."
           "``-t``, ``--max-ss``, ``--max-time=TIMESPAN``","Kill Apache workers whose ""time since the beginning of the most recent
           request"" is greater than specified by the ``TIMESPAN`` argument. ``TIMESPAN`` is
           expected to be a human readable timespan like 2s (2 seconds), 3m (3
           minutes), 5h (5 hours), 2d (2 days), etc."
           "``-f``, ``--data-file=PATH``","Change the pathname of the file where the Apache manager stores monitoring
           metrics after every run. Defaults to ""/tmp/apache-manager.txt""."
           "``-z``, ``--zabbix-discovery``","Generate a JSON fragment that's compatible with the low-level discovery
           support in the Zabbix monitoring system. With the right template in place
           this enables the Zabbix server to discover the names of the WSGI process
           groups that are active on any given server. This makes it possible to
           collect and analyze the memory usage of specific WSGI process groups."
           "``-n``, ``--dry-run``, ``--simulate``",Don't actually kill any Apache workers.
           "``-v``, ``--verbose``",Increase verbosity (can be repeated).
           "``-q``, ``--quiet``",Decrease verbosity (can be repeated).
           "``-h``, ``--help``",Show this message and exit.
        
        .. [[[end]]]
        
        Contact
        -------
        
        The latest version of `apache-manager` is available on PyPI_ and GitHub_. The
        documentation is hosted on `Read the Docs`_ and includes a changelog_. For bug
        reports please create an issue on GitHub_. If you have questions, suggestions,
        etc. feel free to send me an e-mail at `peter@peterodding.com`_.
        
        License
        -------
        
        This software is licensed under the `MIT license`_.
        
        © 2019 Peter Odding.
        
        
        .. External references:
        .. _Apache web server: https://en.wikipedia.org/wiki/Apache_HTTP_Server
        .. _changelog: https://apache-manager.readthedocs.io/en/latest/changelog.html
        .. _documentation: https://apache-manager.readthedocs.io
        .. _GitHub: https://github.com/xolox/python-apache-manager
        .. _metrics: https://en.wikipedia.org/wiki/System_monitoring
        .. _MIT license: http://en.wikipedia.org/wiki/MIT_License
        .. _mod_status: http://httpd.apache.org/docs/current/mod/mod_status.html
        .. _per user site-packages directory: https://www.python.org/dev/peps/pep-0370/
        .. _peter@peterodding.com: peter@peterodding.com
        .. _PyPI: https://pypi.python.org/pypi/apache-manager
        .. _Read the Docs: https://apache-manager.readthedocs.io
        .. _virtual environments: http://docs.python-guide.org/en/latest/dev/virtualenvs/
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
