in case anyone else has this issue, here's how i did it:

  start program = "/bin/bash -c '/usr/bin/monit unmonitor tomcat; /sbin/service 
tomcat7 start; sleep 180; /usr/bin/monit monitor tomcat'" with timeout 300 
seconds

--
Jayen Ashar
SysAdmin/Developer @TripGo
"All the ways" http://skedgo.com/

-----Original Message-----
From: [email protected] on behalf of 
Jayen Ashar
Sent: Tue 18/02/2014 11:50 AM
To: [email protected]
Subject: tell monit to ignore fails during a restart
 
Hi there,

Great tool.

I'm using monit 5.1.1 on centos 6 and having trouble getting it to ignore 
failures during a restart.  I would prefer not to increase the timeout during 
the check, nor increase the daemon mode polling interval (because this impacts 
how quickly monit responds to a failure).

This was my latest attempt:

check process tomcat with pidfile /var/run/tomcat7.pid
  start program = "/bin/bash -c '/sbin/service tomcat7 start; sleep 180'" with 
timeout 300 seconds
  stop program = "/bin/bash -c 'kill -9 $(</var/run/tomcat7.pid)'"
  if failed host localhost port 8080 protocol http
     and request "/war/servlet"
#     with timeout 180 seconds # to allow war time to startup
#     for 3 cycles # to allow war time to [re]start
     then restart
  if 3 restarts within 5 cycles then timeout

Playing with the start program command seems to have no effect.  What is 
happening now is that while monit is restarting tomcat, the http check fails 
because the process is not yet ready.

Is there a way to get monit to skip the http check while tomcat is [re]starting?

Thanks,
Jayen

--
Jayen Ashar
SysAdmin/Developer @TripGo
"All the ways" http://skedgo.com/



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

Reply via email to