monit-general
[Top][All Lists]
Advanced

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

RE: [monit] Problem monitoring mongrel Rails servers


From: SMITH Duncan
Subject: RE: [monit] Problem monitoring mongrel Rails servers
Date: Fri, 4 Apr 2008 15:06:58 +0100

I am giving the full path to the mongrel start/stop script.

The execution of the start/stop script works fine with apache, but not with mongrel using the  following configuration in the .monitrc file:

 check process apache2 with pidfile /web/bin/apache2/logs/httpd.pid
  start program = "/web/bin/apache2/bin/apachectl start"
  stop program = "/web/bin/apache2/bin/apachectl stop"
  if failed host localhost port 80 protocol http
    and request "/" then alert

 check process mongrel_prod_30000 with pidfile /web/docs/myapp.mydomain.inet/current/tmp/pids/mongrel.30000.pid
  if failed host elbrus port 30000 protocol http
     and request "/" then alert
  if totalmem > 100 Mb then restart
  if cpu > 60% for 2 cycles then alert
  if cpu > 80% for 5 cycles then restart
  if loadavg(5min) greater than 10 for 8 cycles then restart
  if 3 restarts within 5 cycles then timeout

  start program = "/etc/init.d/mongrel.server start 30000"
  stop program = "/etc/init.d/mongrel.server stop 30000"
  GROUP mongrels_prod

  check process mongrel_prod_30001 …

If I echo the PATH variable in the /etc/init.d/mongrel.server script it shows the same PATH as root has.

Rgds,

Duncan Smith



-----Original Message-----
From: address@hidden [mailto:address@hidden] On Behalf Of Jan-Henrik Haukeland

Sent: 03 April 2008 17:08
To: This is the general mailing list for monit
Subject: Re: [monit] Problem monitoring mongrel Rails servers


On 3. april. 2008, at 17.08, SMITH Duncan wrote:
> I have checked for permissions problems, but the start and stop
> scripts work fine from the commandline, run as root, and the monit is
> running as root also.
>
> I also tried monitoring apache, and the start/stop worked fine using a
> similar script, so I expect something may be wrong with mongrels but I
> cannot see what it could be, since they work fine otherwise.
>

 From the faq:
For security reasons monit purges the environment and only set a spartan PATH variable that contains /bin, /usr/bin, /sbin and /usr/ sbin. If monit cannot run your program or script cannot, the reason could be that the script expects certain environment variables or to find certain programs via the PATH. If this is the case you should set the environment variables you need directly in the start or stop script called by monit.



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

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email Security System on behalf of Eurostar. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com


Important Note: This E-Mail is confidential, it must not be read,
copied, disclosed or used by any person other than the above
named addressees. Unauthorised use, disclosure or copying is
strictly prohibited and may be unlawful. Eurostar (U.K.) Limited
and Eurostar Group Limited disclaim any liability for any action
taken in reliance on the content of this E-Mail. The comments
or statements expressed in this E-Mail are not necessarily those
of Eurostar (U.K.) Limited, Eurostar Group Limited or any
subsidiaries or affiliates of either company.
Eurostar (U.K.) Ltd. Registered Office: Eurostar House, Waterloo
Station, London, SE1 8SE, Registered in England No. 2462001
VAT No. GB 657 719 590
Eurostar Group Ltd. Registered office: Eurostar House, Waterloo
Station, London, SE1 8SE, Registered in England No. 3794642
VAT No. GB 739 974 173

This email has been scanned for all viruses by the MessageLabs Email
Security System on behalf of Eurostar. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com

reply via email to

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