RabbitMQ Monitoring

Started by gdodd, September 07, 2017, 08:07:26 PM

Previous topic - Next topic

gdodd

Is anyone doing any monitoring of RabbitMQ? I don't know much about Rabbit but our developer department is asking. Looks like you can check a webpage to get the status...

Borgso

RabbitMQ is a more functionel MQTT broker as i understand.
What are you wanting to monitor?
Could you use process count?
You can also make a external script to sniff traffic or test send/ack messages..

gdodd

They want to monitor the queues for number of transactions that are waiting. Basically to make sure that things are working.

Victor Kirhenshtein

Hi,

currently there is no ready to use solution. You probably can build shell script that will use RabbitMQ HTTP API to fetch required information and get it into NetXMS via external parameters.

Best regards,
Victor

gdodd

I have this mostly working except for one part that I cannot understand.

I am using a powershell script to get the statistic that I want and this is returning properly. I am using externalparametersprovider and am able to see the parameter in the node. The issue is the value is not returning when I use a variable in powershell. If I hard code a value, then the hard coded value is returned.

Write-Host Rabbit=$message_count returns "" to the NetXMS server but the output on the powershell window is Rabbit=5000
Write-Host Rabbit=5000 returns "5000" to the NetXMS server

I have also tried echo instead of Write-Host with the same results.

Thank you

gdodd

I think I have it. I will post the solution in a bit.

gdodd

Install the RabbitMQ Management Plugin
https://www.rabbitmq.com/management.html

In the nxagentd.conf of the node I want to monitor RabbitMQ I put:
ExternalParametersProvider = "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" "C:\NetXMS\var\rabbit.ps1":60
Restart the agent

This gives you a Rabbit parameter. You need to poll the node for the config first to see the parameter. Right click the node and see attached screen shots on how to poll and verify parameter is available

I used the attached powershell script. Make changes to $username, $password, $rabbithost, $vhost (if not using default of / (%2F)), $queue
$workingfile gives back a table of all the statistics for the queue

The issue was that the default vhost in rabbit is a '/' which needs coded as %2F. It runs fine in the powershell ISE and was even writing out a debug text file with the correct value. However, when run from the command line, it fails with a "not found" error because the '/' is not interpreted correctly. The function at the top (which is not my own) cleans up the URI correctly and now I get the value back in NetXMS.