1

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?

Sirex
  • 5,447
  • 2
  • 32
  • 54
mahemoff
  • 197
  • 11
  • 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

1 Answers1

2

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; https://github.com/tolland/monit-shared

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.

Tom
  • 10,886
  • 5
  • 39
  • 62
  • although at risk of breaking the rules on recommending products, the professional version is only a couple of hundred euros for unlimited hosts.... ;-) – Tom Feb 29 '12 at 12:37