0

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?

Fabio B.
  • 299
  • 2
  • 5
  • 17

1 Answers1

1

Based on sample

  if failed host localhost port 80 with protocol http and request "/server-status" with timeout 25 seconds for 4 times within 5 cycles then restart

try to put instead

  if failed host www.xxxxxx123123.com port 80 with protocol http 
      and request "/" 
      with timeout 7 seconds 
      then restart
DevOps
  • 720
  • 3
  • 15