Monitoring 为什么monit没有重新启动服务器

Monitoring 为什么monit没有重新启动服务器,monitoring,monit,Monitoring,Monit,我在Ubuntu机器上使用以下配置配置了monit: check process apache with pidfile /var/run/apache2/apache2.pid start program = "/etc/init.d/apache2 start" with timeout 60 seconds stop program = "/etc/init.d/apache2 stop" if cpu > 80% for 5 cycles then restart

我在Ubuntu机器上使用以下配置配置了monit:

check process apache with pidfile /var/run/apache2/apache2.pid
  start program = "/etc/init.d/apache2 start" with timeout 60 seconds
  stop program  = "/etc/init.d/apache2 stop"
  if cpu > 80% for 5 cycles then restart
  if children > 250 then restart
但它不起作用。服务器有时会脱机,但似乎什么也没有发生


你知道为什么不能重新启动吗?

我不知道你说的“服务器有时会离线”是什么意思。因为这可能意味着Apache运行的节点已关闭,也可能意味着
http://localhost:80/
无法访问

如果是以后的情况,则将配置更改为

check process apache with pidfile /var/run/apache2/apache2.pid
  start program = "/etc/init.d/apache2 start" with timeout 60 seconds
  stop program  = "/etc/init.d/apache2 stop"
  if failed host 127.0.0.1 port 80 then restart
  if cpu > 80% for 5 cycles then restart
  if children > 250 then restart

可能有用。因为如果Apache进程正在运行,您的配置将不会重新启动Apache,但由于任何问题,
http://localhost:80/

我不知道你所说的“服务器有时会离线”是什么意思。因为这可能意味着Apache运行的节点已关闭,也可能意味着
http://localhost:80/
无法访问

如果是以后的情况,则将配置更改为

check process apache with pidfile /var/run/apache2/apache2.pid
  start program = "/etc/init.d/apache2 start" with timeout 60 seconds
  stop program  = "/etc/init.d/apache2 stop"
  if failed host 127.0.0.1 port 80 then restart
  if cpu > 80% for 5 cycles then restart
  if children > 250 then restart
可能有用。因为如果Apache进程正在运行,您的配置将不会重新启动Apache,但由于任何问题,
http://localhost:80/