monit-general
[Top][All Lists]
Advanced

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

Re: Apache, rotatelogs & chroot environment


From: Jan-Henrik Haukeland
Subject: Re: Apache, rotatelogs & chroot environment
Date: Wed, 08 Dec 2004 02:10:12 +0100

We should really take code talk like this to the developer list instead,
but since we are here already.. The patch looks good, I have some minor
comments though

1) You should probably call the protocol apache-status as suggested by
Marco since this is for mod_status only. I haven't tried mod_status
myself, but if it has other useful and interesting information you
should try to make the code a little more generic. For instance, so you
could say something like this in the future. Or maybe now, if you can
find at least one other useful thing, in addition to log, to add to the
patch:

if failed host www.example.com port 80 and
   protocol apache-status with log-percent >= 60 and 
   num-request > 100/sec then restart

It will also be more object-oriented if you can put apache stuff in it's
own "sub-struct" in the Port_T data type. Like this:

typedef struct myport {
        .....
        struct apache-status {
            int logLimit;
            int requestLimit;
            ....
        } ApacheStatus;
} *Port_T;


2) Don't edit the monit.html file, it's autogenerated. Edit monit.pod
instead.

3) I see that the get_host_header() is reused from http.c, If you don't
mind, add this to util.c instead with the following signature: (where
len is the length of the buffer to write to). char *get_host_header
(Socket_T s, char *buf, int len); and change the code in http.c also to
use this.

Other than that I'm +1 for adding this patch. Nice work David!

Ps. I'm curios, how was it to implement this patch? Was it hard to
understand the monit code and what you needed to do? Did you get any
help from the NOTES doc? 


On Tue, 2004-12-07 at 23:55 +0000, David Fletcher wrote:
> Hi all,
> 
> Here is a revised patch to implement the mod_status Apache 
> server monitoring using its own protocol file called APACHE, 
> as was suggested previously. 
> 
> Also, as suggested, I have added configuration, so that the 
> trigger level for action can be set in the monitrc file. This
> limit could be passed using the existing "request" parameter, 
> but that could be confusing since in this case it is not a URL.
> I have therefore added a new parameter called "limit". 
> 
> If adding "limit" is not a good idea, I am happy with using the
> "request" paramter - let me know what you think. It is easy to 
> change the patch, or remove remove parts from the it!
> 
> The syntax of /etc/monitrc becomes:
> 
> if failed host www.example.com port 80
>    protocol APACHE limit 60 then restart
> 
> where the "limit" is the percentage of active servers which are 
> locked in the logging state. Adding other status codes used by 
> mod_status would be easy, for example to consider Apache
> child processes which have locked becuase of a DNS look-up failure.
> 
> I have tested this on my server and it seems to work ok. The patch 
> includes some documentation.
> 
> Best wishes,
> 
> David.






reply via email to

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