[CentOS] Service monitoring/"Monit"?

Fri Jun 11 13:59:30 UTC 2010
Karanbir Singh <mail-lists at karan.org>

On 11/06/2010 12:25, Toralf Lund wrote:
>  From reading the docs on the web sites, there are a number of things 
> that are not quite clear, like what the "process" tests actually do, or 
> how I might combine a file test ("does the pid file xist"?) with them (f 
> that's what I want. This is perhaps partly because I don't speak Ruby, 
> and I'm sure what I want is doable...

Ok, that might be a bit of an issue for you - but basically, you get an
object that you can do any sort of tests on. eg

restart.condition(:memory_usage) do |mu|
  mu.above = 1024.megabytes
  mu.times = [ 5,7 ]
end

Which will restart the process if 5 of the last 7 checks indicated it
was using more than 1G of ram. Its basically just ruby and coding around
it, so you can define what the logic or smartness you want around the
monitoring and just code it in.

> Do you happen to know if any of these tools are available from yum 
> repositories and/or in rpm package form?

Not that I am aware of, I've been using them from an internal repo we
have here at work, but thats heavily optimised to our own specific
requirements ( eg. running on ruby 191 etc ). There is a gem2spec app
that will hapily convert a ruby gem into a rpm spec file.

> Definitely. But do my mind, "service A depends on service B" should mean 
> that if service B isn't active, and can't be started, then there will be 
> no attempt to start service B, either - and there might even be an 
> attempt to stop it if it's already running. Not so with Monit, like I 
> said...

This is where the flexibility of God comes into play, you can write any
sort of logic around the conditionals.

- KB