|
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
[Prev in Thread] | Current Thread | [Next in Thread] |