{"id":1643,"date":"2010-07-25T17:13:11","date_gmt":"2010-07-25T16:13:11","guid":{"rendered":"http:\/\/www.devco.net\/?p=1643"},"modified":"2010-07-25T18:10:17","modified_gmt":"2010-07-25T17:10:17","slug":"monitoring_activemq","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2010\/07\/25\/monitoring_activemq.php","title":{"rendered":"Monitoring ActiveMQ"},"content":{"rendered":"

I have a number of ActiveMQ servers, 7 in total, 3 in a network of brokers the rest standalone. For MCollective I use topics extensively so don’t really need to monitoring them much other than for availability. I also though do a lot of Queued work where lots of machines put data in a queue and others process the data.<\/p>\n

In the Queue scenario you absolutely need to monitor queue sizes, memory usage and such. You also need to graph things like rates of messages, consumer counts and memory use. I am busy writing a number of Nagios and Cacti plugins to help with this, you can find them on Github<\/a>.<\/p>\n

To use these you need to have the ActiveMQ Statistics Plugin<\/a> enabled.<\/p>\n

First we need to monitor queue sizes:<\/p>\n

<\/p>\n

\r\n$ check_activemq_queue.rb --host localhost --user nagios --password passw0rd --queue exim.stats --queue-warn 1000 --queue-crit 2000\r\nOK: ActiveMQ exim.stats has 1 messages\r\n<\/pre>\n

<\/code><\/p>\n

This will connect to localhost monitoring a queue exim.stats<\/em> warning you when it’s got 1000 messages and critical at 2000.<\/p>\n

I need to add to this the ability to monitor memory usage, this will come over the next few days.<\/p>\n

I also have a plugin for Cacti it can output stats for the broker as a whole and also for a specific queue. First the whole broker:<\/p>\n

<\/p>\n

\r\n$ activemq-cacti-plugin.rb --host localhost --user nagios --password passw0rd --report broker\r\nstomp+ssl:stomp+ssl storePercentUsage:81 size:5597 ssl:ssl vm:vm:\/\/web3 dataDirectory:\/var\/log\/activemq\/activemq-data dispatchCount:169533 brokerName:web3 openwire:tcp:\/\/web3:6166 storeUsage:869933776 memoryUsage:1564 tempUsage:0 averageEnqueueTime:1623.90502285799 enqueueCount:174080 minEnqueueTime:0.0 producerCount:0 memoryPercentUsage:0 tempLimit:104857600 messagesCached:0 consumerCount:2 memoryLimit:20971520 storeLimit:1073741824 inflightCount:9 dequeueCount:169525 brokerId:ID:web3-44651-1280002111036-0:0 tempPercentUsage:0 stomp:stomp:\/\/web3:6163 maxEnqueueTime:328585.0 expiredCount:0 \r\n<\/pre>\n

<\/code><\/p>\n

Now a specific queue:<\/p>\n

<\/p>\n

\r\n$ activemq-cacti-plugin.rb --host localhost --user nagios --password passw0rd --report exim.stats\r\nsize:0 dispatchCount:168951 memoryUsage:0 averageEnqueueTime:1629.42897052992 enqueueCount:168951 minEnqueueTime:0.0 consumerCount:1 producerCount:0 memoryPercentUsage:0 destinationName:queue:\/\/exim.stats messagesCached:0 memoryLimit:20971520 inflightCount:0 dequeueCount:168951 expiredCount:0 maxEnqueueTime:328585.0\r\n<\/pre>\n

<\/code><\/p>\n

Grab the code on GitHub <\/a>and follow there, I expect a few updates in the next few weeks.<\/p>\n","protected":false},"excerpt":{"rendered":"

I have a number of ActiveMQ servers, 7 in total, 3 in a network of brokers the rest standalone. For MCollective I use topics extensively so don’t really need to monitoring them much other than for availability. I also though do a lot of Queued work where lots of machines put data in a queue […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[7],"tags":[81,89,121,85,64,60,13],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1643"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=1643"}],"version-history":[{"count":6,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1643\/revisions"}],"predecessor-version":[{"id":1650,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1643\/revisions\/1650"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=1643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=1643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=1643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}