monit-general
[Top][All Lists]
Advanced

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

Re: Circular Syntax


From: Chris Lopeman
Subject: Re: Circular Syntax
Date: Sat, 17 Apr 2004 10:35:35 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Thanks for this reply. I missed that part of the restart functionality. This helped clean up my config file quite a bit.

Ugo Bellavance wrote:

-----Message d'origine-----
De : Chris Lopeman [mailto:address@hidden
Envoyé : 9 avril, 2004 13:59
À : address@hidden
Objet : Circular Syntax


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

<UB>
The second one will send to the default adress, the first one will send to your 
pager only.
</UB>

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?
<UB>
I don't think so.  A restart will alert as well.
Have you read the manual? http://www.tildeslash.com/monit/monit.html
I printed it, read it while on the bus to school and it is very clear...
</UB>

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


--
To unsubscribe:
http://mail.nongnu.org/mailman/listinfo/monit-general







reply via email to

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