Install rabbitmqadmin on linux

Shiri picture Shiri · Mar 31, 2016 · Viewed 32.3k times · Source

I'm trying to install and be able to run rabbitmqadmin on a linux machine. Following the instructions described here do not help.

After downloading the file linked, it prompts to copy the file (which looks like a python script) into /usr/local/bin.

Trying to run it by simply invoking rabbitmqadmin results in rabbitmqadmin: command not found. There seems to be no information anywhere about how to get this to work and assumes that all the steps listed on the site should work for all. It seems odd that simply copying a python script to the bin folder should allow it to become a recognised command without having to invoke the python interpreter every time.

Any help is appreciated.

Answer

Isuru Dewasurendra picture Isuru Dewasurendra · Nov 19, 2018

I spent several hours to figure out this, use rabbitmqadmin on linux environment, Finally below steps solve my issue.

On my ubuntu server, python3 was installed, I checked it using below command,

python3 -V

Step 1: download the python script to your linux server

wget https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/v3.7.8/bin/rabbitmqadmin

Step2: change the permission

chmod 777 rabbitmqadmin

Step3: change the header of the script as below(first line)

#!/usr/bin/env python3

Thant's all, Now you can run below commands,

To list down queues,

./rabbitmqadmin -f tsv -q list queues

To Delete ques,

./rabbitmqadmin delete queue name=name_of_queue

To add binding between exchange and queue

./rabbitmqadmin declare binding source="exchangename" destination_type="queue" destination="queuename" routing_key="routingkey"