小编que*_*ner的帖子

让monit先发出警报,然后再重启

我想在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)

alert restart monit

19
推荐指数
1
解决办法
1万
查看次数

标签 统计

alert ×1

monit ×1

restart ×1