monit-general
[Top][All Lists]
Advanced

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

RE: problem with monitoring apache


From: Cryer,Phil
Subject: RE: problem with monitoring apache
Date: Thu, 11 Oct 2007 08:47:25 -0500

> this is the relevant monitrc part that i have been using on my solaris
server for years without a problem (instead of localhost i had the host
set to the 
> servers ip).
>
>  check process apache with pidfile /var/run/apache2.pid
>    start program = "/etc/init.d/apache2 start"
>    stop program  = "/etc/init.d/apache2 stop"
>    if failed host localhost port 80 protocol http
>       and request "/monit"
>       then restart
>
> [CEST Oct 11 02:29:01] info     : Awakened by User defined signal 1
> [CEST Oct 11 02:29:01] error    : HTTP error: Server returned status
404
> [CEST Oct 11 02:29:01] error    : 'apache' failed protocol test [HTTP]
at
> INET[localhost:80] via TCP
> [CEST Oct 11 02:29:01] info     : 'apache' trying to restart
> [CEST Oct 11 02:29:01] info     : 'apache' stop: /etc/init.d/apache2
> [CEST Oct 11 02:29:02] info     : 'apache' start: /etc/init.d/apache2
> 
> am i missing something? could someone help please?

Two things I'd try, first off, in my Apache monit lines I have:

  check process apache with pidfile /var/run/apache2.pid
    start program = "/etc/init.d/apache2 start"
    stop program  = "/etc/init.d/apache2 stop"
    if failed host localhost port 80 protocol http then restart
    if cpu > 60% for 2 cycles then alert
    if cpu > 80% for 5 cycles then restart
    if totalmem > 200.0 MB for 5 cycles then restart
    if children > 250 then restart
    if loadavg(5min) greater than 10 for 8 cycles then stop

So I don't have the line you have, 'request "monit"' - is this needed?
What does it give you over my lines?

Secondly, maybe you're getting a 404 due to it calling localhost, sounds
like it should work, but try the IP and see if that works.  Also, for
logs I use:

Check file access.logs with path /var/logs/access.log
        if size > 10 MB then
        exec "/usr/local/bin/logrotate /var/logs/access.log apache"
Check file error.logs with path /var/logs/error.log
        if size > 10 MB then
        exec "/usr/local/bin/logrotate /var/logs/error.log apache"

Hope that helps.

P
 
 If you are not the intended recipient of this message (including attachments), 
or if you have received this message in error, immediately notify us and delete 
it and any attachments.  If you no longer wish to receive e-mail from Edward 
Jones, please send this request to address@hidden  You must include the e-mail 
address that you wish not to receive e-mail communications.  For important 
additional information related to this e-mail, visit 
www.edwardjones.com/US_email_disclosure




reply via email to

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