Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Most of the monitrc examples I see are verbose, lots of repeated 5-10 line boilerplate checks. Is there any way to parametize this stuff?

I want something like:

ensure_rails 8080
ensure_php 8081
ensure_mysql 10000

Do-able with Monit?

share|improve this question
I'd tag this with "monitrc" and "DRY" if I had permissions, maybe someone could add those tags. I note in passing StackOverflow currently has 405 posts tagged "DRY", I think it would be a valuable resource on ServerFault. – mahemoff Sep 26 '11 at 21:47
up vote 2 down vote accepted

monit is actually pretty basic, as soon as you get past the simple stuff, it starts to glare out.

So no templated checks like you mention. Though it looks like they have a commercial offering which could feed back into the gpl free one, but I fear not :-(

However I started a project on github to try and catch the 80% of requirements cases with a list of per service scripts, to save everyone rehashing boiler plate;

The idea being to have a community repo of scripts that cover most basic installs of those services, it has something for httpd and mysql. However all those scripts are still very rough, so be prepared to do some work...

Also if you use chef, there is a community cookbook for monit that provides a monitrc object similar to how you describe, but I found that it was slightly broken for CentOS, hence starting the monit-shared repo.

share|improve this answer
although at risk of breaking the rules on recommending products, the professional version is only a couple of hundred euros for unlimited hosts.... ;-) – Tom H Feb 29 '12 at 12:37

Your Answer


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.