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 want to have Monit check a web application's health, running a cheap/trivial check frequently and an expensive/nontrivial check less frequently (e.g. 1/5 minutes). How can I tell it to check a given host less frequently than every monitoring interval?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

I was looking at the Monit documentation and stumbled across this:

check process dynamo with pidfile /etc/dynamo.pid every 2 cycles
       start program = "/etc/init.d/dynamo start"
       stop program  = "/etc/init.d/dynamo stop"
       if failed port 8840 then alert

So you could specify any number of check cycles between checks for your expensive check. Configure Monit to have the check interval you desire.

share|improve this answer
add comment

Two options:

  1. Run a second instance of Monit with a different pid file, different check interval and a different config file.
  2. Wrap the expensive check in a script that will repeat the status of the last check until the next "expensive interval". Adjust the alert count to compensate.
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.