RabbitMQ: Verify version of rabbitmq
RabbitmqRabbitmq Problem Overview
How can I verify which version of rabbitmq is running on a server?
Is there a command to verify that rabbitmq is running?
Rabbitmq Solutions
Solution 1 - Rabbitmq
> sudo rabbitmqctl status
and look for line that looks like that:
> {rabbit,"RabbitMQ","2.6.1"},
Solution 2 - Rabbitmq
You can simply execute from the command line:
sudo rabbitmqctl status | grep rabbit
Solution 3 - Rabbitmq
If rabbitimq can not start I found the only way to determine version is via installer system.
Eample Debian/Ubuntu:
dpkg -s rabbitmq-server | grep Version
Solution 4 - Rabbitmq
As Marek said on a local server, or, on a remote server (using amqplib):
from amqplib import client_0_8 as amqp
import sys
conn = amqp.Connection(host=sys.argv[1], userid="guest", password="guest", virtual_host="/", insist=False)
for k, v in conn.server_properties.items():
print k, v
Save as checkVersion.py
and run with python checkVersion.py dev.rabbitmq.com
:
% python checkVersion.py dev.rabbitmq.com
information Licensed under the MPL. See http://www.rabbitmq.com/
product RabbitMQ
copyright Copyright (C) 2007-2011 VMware, Inc.
capabilities {}
platform Erlang/OTP
version 2.6.0
Solution 5 - Rabbitmq
If you have no access to rabbitmqctl or rabbitmq-server is not running, on linux do :
ls /usr/lib/rabbitmq/lib/
I got :
rabbitmq_server-3.5.6
Solution 6 - Rabbitmq
On debian systems, you can just run:
dpkg-query --showformat='${Version}' --show rabbitmq-server
Solution 7 - Rabbitmq
To get RabbitMQ version using the .NET/C# RabbitMQ Client Library:
using (var connection = connectionFactory.CreateConnection())
{
if (connection.ServerProperties.ContainsKey("version"))
Console.WriteLine("Version={0}",
Encoding.UTF8.GetString((byte[])connection.ServerProperties["version"]));
}
Output:
> Version=3.6.3
Solution 8 - Rabbitmq
Since I was looking to do this in C# on a Windows machine and all the current answers are for *nix, I'll post the code that I ended up using:
public string GetRabbitMqVersion()
{
string prefix = "rabbitmq_server-";
var dirs = System.IO.Directory.EnumerateDirectories(@"C:\Program Files (x86)\RabbitMQ Server", string.Format("{0}*",prefix));
foreach (var dir in dirs)
{
//Just grab the text after 'rabbitmq_server-' and return the first item found
var i = dir.LastIndexOf(prefix);
return dir.Substring(i+16);
}
return "Unknown";
}
Solution 9 - Rabbitmq
In the likely event you're using the "management" (web) plug-in, the RabbitMQ version appears in the upper-right corner of every web page, along with the version of the Erlang run-time.
Solution 10 - Rabbitmq
I use following command to trim output down to version,
rabbitmqctl status | grep "{rabbit,\"RabbitMQ\""
Output:
{rabbit,"RabbitMQ","3.7.3"},
Solution 11 - Rabbitmq
On Centos you can use yum list rabbitmq-server
.
Solution 12 - Rabbitmq
Login to management ui and in top right you can find the version. Also use the following command to find the version
# sudo bash
# rabbitmqctl status | grep rabbit