monit-general
[Top][All Lists]
Advanced

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

Re: [monit] RE: problem with monitoring apache


From: monit user
Subject: Re: [monit] RE: problem with monitoring apache
Date: Fri, 12 Oct 2007 18:05:45 -0700
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

Try to do tcpdump (like tcpdump -s 1500 -X -ennvvvi eth0 port 80 and host w.x.y.z or something like that) before starting up monit so that you can get exactly what monit is sending to the web server, I have a vague recollection of this happening with a server I had and working around it somehow... but don't remember the details. I may be mistaken...

address@hidden wrote:
Thank you for your tips, but nothing helped. To your questions

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

the request directive tells monit to request a "path" on the host you are
connecting to. so 'request "monit"' tells in my case monit to look for
http://localhost:80/monit  ... i tried omitting the directive but that
didnt help.

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:

naturally, that was the first thing i tried... while wget and tellnet
resolve the ip correctly monit might have had some problems with it.
unfortunatelly, this was not the case.

any other tips will be quite appreciated.
Pavel


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


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





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




reply via email to

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