[rabbitmq-discuss] RabbitMQ and monit?

Dmitriy Samovskiy dmitriy.samovskiy at cohesiveft.com
Wed Apr 9 17:33:08 BST 2008

Hi Steve,

You can obtain broker's OS process ID by something like this:
sed 's/.*,\(.*\)\}.*/\1/' /var/lib/rabbitmq/pids > /var/run/rabbitmq.pid
perl -ne 'm/,(.*)}/; print $1' /var/lib/rabbitmq/pids

(put it somewhere inside startup script around echo SUCCESS)

This will work if you have one rabbit node. If you have multiple, you can create multiple 
pid files for monit from /var/lib/rabbitmq/pids and monitor each process separately.

And then for monit:

check process rabbitmq-broker with pidfile /var/run/rabbitmq.pid
  start program = "/etc/init.d/rabbitmq start"
  stop program = "/etc/init.d/rabbitmq stop"
  if 5 restarts within 5 cycles then timeout
  alert someone at example.com only on { timeout }

Something like this might work. Please note however that I don't actually run this setup - 
it's just how I might do it when I get around to it.

- Dmitriy

Alexis Richardson wrote:
> Steve
> It's the first I'd heard of it.  Is it something that you would recommend?
> alexis
> On Tue, Apr 8, 2008 at 8:02 PM, Steve Jenson <stevej at gmail.com> wrote:
>> Hi,
>>  Does anybody out there use rabbitmq with monit?
>>  Thanks,
>>  Steve
>>  _______________________________________________
>>  rabbitmq-discuss mailing list
>>  rabbitmq-discuss at lists.rabbitmq.com
>>  http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

More information about the rabbitmq-discuss mailing list