当你用pid监控一个Monit的进程时,比如:
check process blop with pidfile /.../blop.pid start program = "..." stop program = "..."
当pidfile被改变时你会得到一个警报。
你如何禁用此警报? 例如,如果您只想知道何时该进程无法重新启动。
您可以通过设置本地警报语句来禁用此警报。 这是详细logging在这里: http : //mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement
这应该做到这一点:
check process blop with pidfile /.../blop.pid alert [email protected] but not on { pid } start program = "..." stop program = "..."
另一个选项是禁用警报
set alert [email protected] not on { instance, action }
这样你将不会收到monit restart( instance
)的警报,也不会收到所有服务启动/停止/重新启动( action
)的警报。
完整的可能的过滤列表可以在以下urlfind: https : //mmonit.com/monit/documentation/monit.html#Setting-an-event-filter (我想这个列表也应该适用于附加到过程检查的警报这个问题的另一个答案)。