I am using this configuration for monitoring apache2 (ubuntu):
/etc/monit/conf.d/apache2:
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"
alert f.bozzo@3-w.it with mail-format {
from: monit@3-w.it
subject: monit alert: $SERVICE $EVENT $DATE
message: $DESCRIPTION
}
if failed port 80 protocol HTTP
request /
with timeout 7 seconds
then restart
Accessing 'request /' results in the ubuntu-apache default page: if you can reach it, then Apache is working. And that's ok.
Now I need to monitor my application server, too. So I have a second configuration file:
check process lucee with pidfile /opt/lucee/tomcat/work/tomcat.pid
start program = "/etc/init.d/lucee_ctl start" with timeout 60 seconds
stop program = "/etc/init.d/lucee_ctl stop"
I don't know exactly how to tell monit to request a fully qualified URI, I need something like
if failed port 80 protocol HTTP
request http://www.xxxxxx123123.com/
with timeout 7 seconds
then restart
but that says
/etc/monit/conf.d/lucee:13: Error: syntax error '
on reload. Any idea?