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?
Asked
Active
Viewed 4,850 times
2 Answers
14
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.
![](../../users/profiles/85476.webp)
Jodie C
- 733
- 6
- 9
2
Two options:
- Run a second instance of Monit with a different pid file, different check interval and a different config file.
- 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.
![](../../users/profiles/85476.webp)
Jodie C
- 733
- 6
- 9