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";
}
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.
I use following command to trim output down to version,
Output:
To get RMQ version using C#
Output:
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:
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.
and look for line that looks like that:
If rabbitimq can not start I found the only way to determine version is via installer system.
Eample Debian/Ubuntu: