[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Circular Syntax
From: |
Ugo Bellavance |
Subject: |
RE: Circular Syntax |
Date: |
Sat, 10 Apr 2004 00:11:12 -0400 |
-----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
- Circular Syntax, Chris Lopeman, 2004/04/09
- RE: Circular Syntax,
Ugo Bellavance <=