我想在monit处理一种连锁动作.
我的尝试(到目前为止):
check process myprocess with pidfile /run/my.pid
start program = "/path/to/binary start" with timeout 60 seconds
stop program = "/path/to/binary stop" with timeout 60 seconds
if not exist for 3 cycles then restart
if not exist then alert
if 3 restarts within 3 cycles then timeout
Run Code Online (Sandbox Code Playgroud)
在故障PID时不报警并保持状态"运行",但在3个周期后重新启动.
check process myprocess with pidfile /run/my.pid
start program = "/path/to/binary start" with timeout 60 seconds
stop program = "/path/to/binary stop" with timeout 60 seconds
if not exist for 3 cycles …Run Code Online (Sandbox Code Playgroud)