【发布时间】:2016-03-29 00:59:19
【问题描述】:
基本上是在文件“product_id”准备好时启动进程“CAD”的监视器。我的配置如下:
check file product_id with path /etc/platform/product_id
if does not exist then alert
check process cad with pidfile /var/run/cad.pid
depends on product_id
start = "/bin/sh -c 'cd /home/root/cad/scripts;./run-cad.sh 2>&1 | logger -t CAD'" with timeout 120 seconds
stop = "/bin/sh -c 'cd /home/root/cad/scripts;./stop-cad.sh 2>&1 | logger -t CAD'"
我希望“monit”调用“start”,直到文件可用。但似乎它在每个周期都重新启动了进程(停止和启动)。
这里有什么配置错误吗?
感谢任何帮助。
【问题讨论】:
-
为什么要使用“检查过程”块?查看文档,如果“检查文件”块中不存在文件mmonit.com/monit/documentation/monit.html#EXISTENCE-TESTING,您似乎可以执行脚本
标签: monit