Skip to content

Instantly share code, notes, and snippets.

@kyleburton
Created November 24, 2009 21:32
Show Gist options
  • Save kyleburton/242244 to your computer and use it in GitHub Desktop.
Save kyleburton/242244 to your computer and use it in GitHub Desktop.
cat scripts/monitor.sh
CMD=$(cat <<END_OF_COMMAND
echo;
echo '*** LISTING QUEUES for myvhost ***';
echo 'name, consumers, messages_ready, messages_unacknowledged';
rabbitmqctl -q list_queues -p 'myvhost' name consumers messages_ready messages_unacknowledged ;
echo;
echo '*** LISTING CONNECTIONS ***' ;
echo 'node, address, port, peer_address, peer_port, state, channels, user, vhost, timeout';
rabbitmqctl -q list_connections node address port peer_address peer_port state channels user vhost timeout ;
echo ;
echo '*** LISTING QUEUES for othervhost ***' ;
echo 'name, consumers messages_ready, messages_unacknowledged';
rabbitmqctl -q list_queues -p 'othervhost' name consumers messages messages_ready messages_unacknowledged ;
echo ;
echo '*** rabbit log ***';
tail -n 10 /var/log/rabbitmq/rabbit.log | ruby -ne 'puts "AMQP: #\$_"';
echo '';
echo '*** LISTING USERS ***' ;
echo \$(rabbitmqctl -q list_users);
echo ;
echo '*** vhost EXCHANGES ***' ;
echo \$(rabbitmqctl -q list_exchanges -p 'vhost');
echo;
echo '*** othervhost EXCHANGES ***' ;
echo \$(rabbitmqctl -q list_exchanges -p 'othervhost');
END_OF_COMMAND)
sudo watch -n 1 "$CMD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment