Thanks Martin. This helps. I was searching for content related to "alert" in the online documentation and in stackoverflow posts and so couldn't find the relevant information.

Thanks,
Rahul.

On Friday 06 March 2015 03:00 AM, Martin Pala wrote:
Hi,

first - when the process is monitored by Monit, you should either restart it 
gracefully via Monit or at least disable the monitoring before manual actions:

Either:

        monit restart jetty8  # restart via Monit

Or:
Madhavi or
        monit unmonitor jetty8   # disable monitoring
        /etc/init.d/jetty8 restart   # e.g. restart/deploy the service manually
        monit monitor jetty8       # enable monitoring


You can also suppress the restart on first failure like this (not recommended 
as workaround for manual actions - above solution is better):

--8<--
check process jetty8 with pidfile /var/run/jetty8.pid for 2 cycles
    start program = "/etc/init.d/jetty8 start"
    stop program = "/etc/init.d/jetty8 stop"
    if does not exist for 2 cycles then restart
--8<--


Regards,
Martin


On 05 Mar 2015, at 03:36, Rahul Amaram <[email protected]> wrote:

Hi,
I am facing a particular issue. I have defined a monit configuration for jetty8 
as below:

check process jetty8 with pidfile /var/run/jetty8.pid
  start program = "/etc/init.d/jetty8 start"
  stop program = "/etc/init.d/jetty8 stop"

Now, the problem is at times, when I restart jetty8 manually, and within that 
short duration, if monit check runs, it assumes that jetty8 is not running, 
tries to restart it and sends an alert.

I would like to use something like "for X cycles" feature. Where in monit does 
not attempt restart of jetty8 (or send alert) unless it finds jetty8 down for X 
consecutive cycles. I have tried the following syntax but it is invalid.

check process jetty8 with pidfile /var/run/jetty8.pid for 2 cycles
  start program = "/etc/init.d/jetty8 start"
  stop program = "/etc/init.d/jetty8 stop"


Suggestions on how this can be achieved would be highly appreciated.

Thanks,
Rahul.

--
<http://www.festivalofmedia.com/asia-pacific/awards>

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

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


--
<http://www.festivalofmedia.com/asia-pacific/awards>

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

Reply via email to