Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have:

  1. Tomcat with webapp deployed via mvn tomcat:redeploy.
  2. Monit, pinging the host and restarting server if ping failed.

The thing is there in a moment during the redeployment when ping will fail - and this is normal, actually.

So, the question is - what is the best way to teach monit to consider the fact of redeployment and not to confuse it with "real" black outs.

This is of course an issue of balance between elegance, ease of implementation and scalability. The most straightforward solution I can think of - is just to shutdown monit before deployment and start it up after once again. But this if far from elegance I guess.

share|improve this question
    
Why would a ping fail during (hot?) deployment? The only reason I see is when your machine and/or network is starved of resources, and ICMP packets are dropped because of that, which isn't exactly normal. –  pyroscope Apr 11 '12 at 5:36
add comment

1 Answer

up vote 4 down vote accepted

The trick is to tell monit to 'unmonitor' the target while it's down. the monit binary uses the built-in http server for these actions. Note that the httpd is not brought up until the (eventual) "delay" time has passed.

In monitrc:

 set httpd port 2812 and use the address localhost
    allow localhost

You can check the status of your check:

monit status <check_name>

Unmonitor with:

monit unmonitor <check_name>

Monitor again with:

monit monitor <check_name>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.