monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Circular Syntax


From: Chris Lopeman
Subject: Circular Syntax
Date: Fri, 09 Apr 2004 12:59:20 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Hi All,

I think I am missing something with the syntax for the monit configuration file.  To me it seems sort of circular and I am not comfortable that I am actually setting up the config correctly. 

Bellow I included  part of my configuration for monitor in apache.  I was hopping somebody could tell me where I am going wrong, if anyplace.

check process apache with pidfile /var/run/httpd.pid
        group webserver
        alert address@hidden only on {timeout restart}
        start program = "/etc/init.d/httpd start"
        stop program  = "/etc/init.d/httpd stop"
        if 5 restarts within 8 cycles then timeout      # Apache wont run stop trying
        if failed host www.MySite.com port 80 with timeout 15 seconds
                then restart
        if failed host www.MySite.com port 80 with timeout 15 seconds
                then alert
        if failed host www.MySite.com port 443 with timeout 15 seconds
                then restart
        if failed host www.MySite.com port 443 with timeout 15 seconds
                then alert
        depends on apache_bin
        depends on apache_conf

Let me explain my confusion.  For starters the first line the check line.  What does this line really do.   The syntax implies a testing action but my current best guess it is just to name and separate  processes.  So does a check without an "IF" ever provide a restart or alert?

If the check does actually test and react then why have IF statements.  Now supposedly you can set an alert to occur only on certain events.  But what is the difference between

      alert address@hidden only on {timeout}

AND THIS?
 if failed port 80 protocol http then alert

Also notice I have redundant tests (see below) .  I am not even sure this will work.  If the restart happens when it fails then will the next test pass therefore not triggering the alert.  I tried to put alert and restart in the then statement but that wouldn't compile.

        if failed host www.MySite.com port 80 with timeout 15 seconds
                then restart
        if failed host www.MySite.com port 80 with timeout 15 seconds
                then alert

Does the above make sense?  For me the desire is to restart the process as soon as possible and then be notified that there was a problem and it needed to be restarted.  This would seem like a fairly common requirement.  But how I have it, feels unnatural.


Thanks,

Chris

reply via email to

[Prev in Thread] Current Thread [Next in Thread]