25

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.

3
  • That should work fine unless, for some strange reason, /usr/local/bin is not specified on your $PATH.
    – Quentin
    Commented Mar 31, 2016 at 14:26
  • 1
    "without having to invoke the python interpreter" — see en.wikipedia.org/wiki/Shebang_(Unix)
    – Quentin
    Commented Mar 31, 2016 at 14:26
  • /usr/local/bin is indeed specified on my $PATH.
    – Shiri
    Commented Mar 31, 2016 at 14:27

5 Answers 5

23

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"
1
  • 2
    This helped, however I disagree with the chmod 777 and agree with @Shiri in regard to the only adding of the execute permissions. I would further that to only the user/group of that will be running the commands as well.
    – ShaneMit
    Commented Feb 4, 2019 at 16:51
16

RabbitMQ decided to omit one vital piece of information.

Make the script executable with chmod +x otherwise it will fail to work.

9

I want to post my commands for installing rabbitmqadmin, it is combination of other answers, but with a little improvements for using best practice:

sudo rabbitmq-plugins enable rabbitmq_management
wget 'https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/v3.7.15/bin/rabbitmqadmin'
chmod +x rabbitmqadmin
sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python3|' rabbitmqadmin
mv rabbitmqadmin .local/bin/
rabbitmqadmin -q list queues

I suppose that you already create .local/bin/ dir and add it to PATH (on Ubuntu bash add this dir to PATH if it exists).

4

After install Rabbbitmq on Ubuntu/Debian, you can activate the Rabbitmq Admin Portal using the next command:

rabbitmq-plugins enable rabbitmq_management

Then you can access to the portal from http://localhost:15672. Use the user/password "guest".

0
4

Below the steps to install rabbimqadmin:

cd /usr/local/bin/
wget http://127.0.0.1:15672/cli/rabbitmqadmin
chmod 777 rabbitmqadmin

For more details check the official documentation Obtaining rabbitmqadmin

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.