Home > cloud, linux > Monitoring rabbitmq server 2.5.1. with monit

Monitoring rabbitmq server 2.5.1. with monit

Simple task like setting up monitoring with monit for rabbit mq include two parts: 1) As discussed here Modify /etc/init.d/rabbitmq-server

  1. The following are added to the start function:
  2.   pid=`/usr/sbin/rabbitmqctl status | perl -n -e'/{pid,(\d+)/ && print
  3. $1'`
  4.   echo $pid > /var/run/rabbitmq.pid
  5. Right before:
  6.   echo SUCCESS
  7. The pid file is deleted within the stop function:
  8.          rm /var/run/rabbitmq.pid
  9. right after,
  10.          if [ $RETVAL = 0 ] ; then

2) Add this to monit configuration file:

  1. ### rabbitmq-server
  2. check process rabbitmq-server with pidfile /var/run/rabbitmq.pid
  3.      group rabbitmq
  4.      start program "/etc/init.d/rabbitmq-server start"
  5.      stop program "/etc/init.d/rabbitmq-server stop"
  6.      if failed port 5672 type tcp then restart
  7.      if 3 restarts within 3 cycles then timeout
Tags: , , ,
  • http://camilonova.com Camilo Nova

    Thanks a lot!

  • Vancouver Mini Storage

    Thanks for the share, i appreciate your blog.