我试图在我的ubuntu服务器上为tomcat配置monit,但是当我执行时:

monit reload 

它抛出一个错误:

/etc/monit/monitrc:292: Program does not exist: 'if' 

我不知道为什么会这样。

我在文件末尾添加了配置:

/etc/monit/monitrc 

这是我的配置代码:

check process tomcat7 with pidfile "/usr/local/tomcat/tomcat.pid"   start program = "/etc/init.d/tomcat start"   stop program = " "/etc/init.d/tomcat stop"   if failed port 8080 for 5 cycles then restart     include /etc/monit/conf.d/*    include /etc/monit/conf-enabled/* 

我究竟做错了什么? 为什么会引发此错误?

谢谢!

===============>>#1 票数:0 已采纳

您只是在stop program有一个双引号太多。

它应该是:

check process tomcat7 with pidfile "/usr/local/tomcat/tomcat.pid"   start program = "/etc/init.d/tomcat start"   stop program = "/etc/init.d/tomcat stop"   if failed port 8080 for 5 cycles then restart    include /etc/monit/conf.d/*   include /etc/monit/conf-enabled/* 

  ask by Abraham translate from so

本文未有回复,本站智能推荐: