我正在使用 monit 来监控几个自定义的 rails 守护进程。他们在树莓派上缓慢启动(这并不奇怪)。但是 monit summary 命令会在日志waiting
中execution failed
显示守护程序正在运行,并且警报电子邮件也是如此。守护程序不会连续重新启动。
我的监视器配置文件看起来像
check process setpoint_manager with pidfile /opt/thermyos.com/server/current/tmp/pids/setpoint_manager.pid every 2 cycles
start program = "/etc/init.d/setpoint_manager start" as uid thermyos and gid thermyos
stop program = "/etc/init.d/setpoint_manager stop"
if 5 restarts within 5 cycles then timeout
monit 守护程序循环时间为 60 秒。日志文件显示
[EDT Aug 30 17:38:35] info : 'setpoint_manager' process is running with pid 2984
监控电子邮件说
Exists Service setpoint_manager
Date: Fri, 30 Aug 2013 17:38:35
Action: alert
Host: thermdev
Description: process is running with pid 2984
我已经验证了 pid 文件和ps ax
匹配。如果我通过 monit 重新启动守护程序,状态将变为正确。
为什么监控状态不能自我纠正?