I have got monit installed on a lot of our VMs. It all works fine except for this one VM.
Monit is set to monitor apache and check if it is down. For some reason, monit is saying that apache is down (it is not) and that it needs to be restarted. After it tries to run the start script, it still says 'failed to start. The monit log is as follows:
[CEST Oct 4 20:16:21] error : 'apache2' process is not running
[CEST Oct 4 20:16:21] info : 'apache2' trying to restart
[CEST Oct 4 20:16:21] info : 'apache2' start: /etc/init.d/apache2
[CEST Oct 4 20:16:52] error : 'apache2' failed to start
The apache server still works after this and monit still says it is not started and will unmonitor.
My config for apache is as follows:
check process apache2 with pidfile /var/run/apache/apache2.pid
alert email@domain.com but not on { pid }
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if failed host vm01.domain.com port 80
protocol HTTP request "/monit_check.html" then restart
if cpu > 60% for 2 cycles then alert
if 5 restarts within 5 cycles then timeout
The server is an ubuntu 14.01.1 LTS linux server. Any help would be kindly appreciated!