从python监视和控制apache web服务器工作程序

apache-manager的Python项目详细描述


https://travis-ci.org/xolox/python-apache-manager.svg?branch=masterhttps://coveralls.io/repos/xolox/python-apache-manager/badge.svg?branch=master

apache管理器包有助于收集有关 Apache web server并杀死超过资源阈值的工作进程。 它通过解析由apache的 mod_status模块。它目前在Python2.6、2.7、3.4、3.5、3.6上进行了测试, 3.7和派比。

Status

一方面,apache管理器包是基于许多 多年与Apache web server交互(和监视)的经验 使用apache本身提供的接口(mod_status)以及 Linux操作系统接口(/proc)。

另一方面,python包本身是全新的:它是由 2015年6月至9月。

再说一遍,我对测试覆盖率很有信心,所以有一点:-)。

尽管自动化测试覆盖了整个软件包,但我还没有 提交向后兼容,因为我首先要运行此包 在一段时间的生产环境中 它很坚固。我还需要评估整合当前 监控系统的解决方案(这是一个目标,但我并不总能实现 我第一次尝试的目标是…)。

Installation

apache管理器包可以在PyPI上使用,这意味着安装 应该简单到:

$ pip install apache-manager

实际上有很多方法可以安装python包(例如per user site-packages directoryvirtual environments),或者只安装 我不打算在这里讨论,所以 如果这让你感到害怕,那么在回到这些之前,先阅读一下你的选项 说明;-)。

Usage

有两种方法可以使用apache管理器包:作为命令行 程序apache-manager,并作为python api。有关python的详细信息 api请参阅Read the Docs上提供的api文档。这个 命令行界面如下所述。

Command line

用法:apache manager[选项]

用于监视apache web服务器并杀死worker的命令行界面 超过资源阈值的进程。当没有给出选项时 服务器度量和工作线程的内存使用量将打印到终端。

支持的选项:

OptionDescription
^{tt3}$, ^{tt4}$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.
^{tt5}$, ^{tt6}$Kill active Apache workers that are using more memory than specified by the ^{tt7}$ argument. ^{tt7}$ is expected to be a human readable memory size like 50K (50 kilobytes), 42M (42 megabytes), 2G (2 gigabytes), etc.
^{tt9}$, ^{tt10}$Kill Apache workers that are using more memory than specified by the ^{tt7}$ argument (see ^{tt12}$ for acceptable values of ^{tt7}$).
^{tt14}$, ^{tt15}$, ^{tt16}$Kill Apache workers whose “time since the beginning of the most recent request” is greater than specified by the ^{tt17}$ argument. ^{tt17}$ is expected to be a human readable timespan like 2s (2 seconds), 3m (3 minutes), 5h (5 hours), 2d (2 days), etc.
^{tt19}$, ^{tt20}$Change the pathname of the file where the Apache manager stores monitoring metrics after every run. Defaults to “/tmp/apache-manager.txt”.
^{tt21}$, ^{tt22}$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.
^{tt23}$, ^{tt24}$, ^{tt25}$Don’t actually kill any Apache workers.
^{tt26}$, ^{tt27}$Increase verbosity (can be repeated).
^{tt28}$, ^{tt29}$Decrease verbosity (can be repeated).
^{tt30}$, ^{tt31}$Show this message and exit.

Contact

apache管理器的最新版本可以在PyPIGitHub上找到。这个 文档位于Read the Docs上,并包含一个changelog。对于Bug 报告请在GitHub上创建问题。如果你有问题,建议, 等等,请随时给我发一封电子邮件peter@peterodding.com

License

此软件是根据MIT license授权的。

?2019彼得·奥丁。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
具有未知数量条件的java If语句   java如何在Spark中使用两个“条件”进行过滤?   雅加达ee为ColdFusion提供的最佳Java ee服务器   java如何在jersey的MessageBodyWriter方法中获取writeTo中的anotations值?   java从脚本文件调用jar文件中的函数   java在执行insert语句后,如何获得id值为的语句?   在OS X上设置OpenCV Java绑定   java使用for循环遍历数组x。以字符串形式返回x的元素,其中每个元素由一个空格分隔   ApacheiClientBuilder为Algolia Java创建的APIClient是线程安全的吗?   java在DFS/BFS算法中获取邻居时避免内存分配?   java使用AES/CBC/PKCS5P加密大文件(2GB)   允许保存/加载列布局的Java DB网格组件   队列大小为1的java Spring调度   跑步带有Java参数的exe   java正则表达式将所有“<”和“>”标记替换为“&lt;”及“&gt;”在<<![CDATA]>标签?   java何时同步变量?