monit-general
[Top][All Lists]
Advanced

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

Re: monit start/stop in a synchronous mode


From: Martin Pala
Subject: Re: monit start/stop in a synchronous mode
Date: Tue, 14 Oct 2014 12:12:34 +0200

On 14 Oct 2014, at 11:18, Alainkr <address@hidden> wrote:

> Martin Pala wrote
>> If i understand you corrently, you wanted CLI to not return before the
>> action is done by Monit?
> 
> Thinking about it there's 2 aspect to it :
> 
> (1) Wait until invocation of the "stop program" returns
> (2) Wait until the PID as specified in the pid file finishes
> 
> both are interesting. My primary need was for (1).

Monit 5.9 uses both steps for start/stop/restart programs - unline the "exec" 
action in the test rule, which returns immediately and lets the program finish 
on the background.

I recommend to modify the configuration like this:

--8<--
check file myappcol-log with path  /home/myappcol/tomcat/logs/catalina.out
        mode manual
        group myappcol
        depends on myappcol
        if match "ERROR" then alert
        if match "ERROR" for 10 cycles then unmonitor
        if match "OutOfMemoryError" then exec '/usr/bin/monit restart myappcol' 
   # note: this restarts the myappcol service via monit (fix the monit path if 
not present in /usr/bin/)
--8<--

Regards,
Martin




reply via email to

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