使用Python自动进行过程监控/管理 [英] Automatic process monitoring/management with Python
问题描述
对,所以我有一个不断运行的python进程,甚至在Supervisor上也可以.实现以下监视的最佳方法是什么?
Right, so I have a python process which is running constantly, maybe even on Supervisor. What is the best way to achieve the following monitoring?
- 发送警报,如果进程崩溃,则重新启动.我想在每次程序崩溃时自动接收信号并自动重启它.
- 如果该过程过时,即1分钟未处理任何内容,则发送警报并重新启动.
- 按需重启
我想通过Python实现以上所有功能.我知道Supervisord将完成大部分操作,但是我想看看它是否可以通过Python本身完成.
I'd like the achieve all of the above through Python. I know Supervisord will do most of it, but I want to see if it can be done through Python itself.
推荐答案
我认为您正在寻找的是Supervisor Events. http://supervisord.org/events.html
I think what you are looking for is, Supervisor Events. http://supervisord.org/events.html
还要看一下Superlance,它是一套插件实用程序,用于监视和控制在超级用户下运行的进程. [ https://superlance.readthedocs.org/en/latest/]
Also look at Superlance, its a package of plugin utilities for monitoring and controlling processes that run under supervisor. [https://superlance.readthedocs.org/en/latest/]
您可以配置崩溃电子邮件,崩溃SMS,内存消耗警报,HTTP挂钩等内容.
You can configure stuff like Crash emails, Crash SMS, Memory consumption alerts, HTTP hooks etc.
这篇关于使用Python自动进行过程监控/管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!