Skip to main content

ActiveMQ JMX

Overview

Apache ActiveMQ is an open source message broker written in Java together with a full Java Message Service (JMS) client.

Monitoring Connector assets

Monitored objects

  • Brokers (queue / topic)

Discovery rules

Rule nameDescription
App-Activemq-Jmx-Brokers-NameDiscover ActiveMQ Broker

Monitored metrics

Metric nameDescription
Broker.store.usage.percentageBroker store percentage usage. Unit: %
Broker.temporary.usage.percentageBroker temporary store percentage usage. Unit: %
Broker.memory.usage.percentageBroker memory usage. Unit: %
Broker.queue.average.enqueue.time.millisecondsBroker average enqueue time (queue). Unit: ms
Broker.queue.consumers.connected.countBroker queue connected consumers. Unit: count
Broker.queue.producers.connected.countBroker queue connected producers . Unit: count
Broker.queue.memory.usage.percentageBroker queue memory usage. Unit: %
Broker.queue.size.countBroker queue size. Unit:count
Broker.queue.messages.enqueued.countBroker enqueued messages. Unit: count
Broker.queue.messages.dequeue.countBroker dequeued messages. Unit: count
Broker.queue.messages.expired.countBroker queue expired messages. Unit: count
Broker.queue.messages.inflighted.countBroker queue inflighted messages. Unit: count
Broker.queue.messages.size.average.bytesBroker queue average messages size. Unit: bytes
Broker.topic.average.enqueue.time.millisecondsBroker average queue time per topic. Unit: ms
Broker.topic.consumers.connected.countBroker connected consumers per topic. Unit: count
Broker.topic.producers.connected.countBroker connected producers per topic. Unit: count
Broker.topic.memory.usage.percentageBroker memory percentage usage per topic. Unit: %
Broker.topic.size.countBroker topic size. Unit:count
Broker.topic.messages.enqueued.countBroker enqueued messages per topic. Unit: count
Broker.topic.messages.dequeue.countBroker messages deuque per topic. Unit: count
Broker.topic.messages.expired.countBroker expired messages per topic. Unit: count
Broker.topic.messages.inflighted.countBroker inflighted messages per topic. Unit: count
Broker.topic.messages.size.average.bytesBroker average messages size per topic. Unit: bytes

Prerequisites

ActiveMQ configuration

ActiveMQ provides a Jolokia RestAPI reachable on http://server_name:8161/api/jolokia More information on how to set up and configure the ActiveMQ RestAPI can be found in the official documentation: https://activemq.apache.org/rest

Installation

  1. Install the Plugin on every poller expected to monitor ActiveMQ resources:
yum install centreon-plugin-Applications-ActiveMQ-Jmx
  1. On the Centreon Web interface, install the ActiveMQ JMX Centreon Monitoring Connector from the Configuration > Monitoring Connector Manager page

Configuration

  • Log into Centreon and add a new Host through "Configuration > Hosts".
  • Apply the App-Activemq-JMX-custom template to the Host and configure all of the Macros marked as mandatory :
MandatoryNameDescription
XJOLOKIAURLJolokia URL (eg: http://myactivemq.centreon.com:8161/api/jolokia)
XJOLOKIAUSERNAMEJolokia user name
XJOLOKIAPASSWORDJolokia password
JOLOKIAEXTRAOPTIONSAny extra option you may want to add to the command (eg. a --verbose flag)

It is recommended to use the discovery module to add the monitoring of your *Brokers Go to Configuration > Services > Scan* to perform a scan and easily add the discovered resources

FAQ

How can I test the Plugin in the command line interface and what do the main options mean?

Once the Plugin installed, you can test it directly from the command line of the Centreon poller using the centreon-engine user:

/usr/lib/centreon/plugins/centreon_activemq_jmx.pl \
--plugin apps::mq::activemq::jmx::plugin \
--mode='brokers' \
--url='http://myactivemq.int.centreon.com:8161/api/jolokia' \
--username='admin' \
--password='admin' \

This command will check all the Brokers (--mode='brokers') of the ActiveMQ server of the myactivemq.int.centreon.com server. The RestAPI endpoint is set on the http://myactivemq.int.centreon.com:8161/api/jolokia URL (--url='http://myactivemq.int.centreon.com:8161/api/jolokia'). To authenticate against the Jolokia agent, the API username admin is used with the relevant password (--username='admin' --password='admin').

If everything's fine, it should output something similar to:

OK: Broker 'localhost' store usage: 0.00 %, temporary usage: 0.00 %, memory usage: 0.00 % - 
queue 'foo.bar' average time messages remained enqueued: 0.000 ms, consumers connected: 0, producers connected: 0, memory usage: 0.00 %,
queue size: 1, messages enqueued: 0, messages dequeued: 0, messages expired: 0, messages in-flighted: 0, average messages size: 1.09 KB - All topics are ok |
'localhost#Broker.store.usage.percentage'=0.00%;;;0;100 'localhost#Broker.temporary.usage.percentage'=0.00%;;;0;100 'localhost#Broker.memory.usage.percentage'=0.00%;;;0;100

The available thresholds as well as all of the options that can be used with this Plugin can be displayed by adding the --help parameter to the command:

/usr/lib/centreon/plugins/centreon_activemq_jmx.pl \
--plugin apps::mq::activemq::jmx::plugin \
--mode Brokers \
--help

You can display all of the modes that come with the Plugin with the command below:

/usr/lib/centreon/plugins/centreon_activemq_jmx.pl \
--plugin apps::mq::activemq::jmx::plugin \
--list-mode

Why do I get the following error:

UNKNOWN: protocol issue: Error while fetching http://myactivemq.int.centreon.com:8161/url/path

This error message means that the Plugin failed to request the API. Check your credentials.

UNKNOWN: JMX Request: Cant get a single value.

This error message means that the Plugin failed to get the value from the API. Check the URL path.

UNKNOWN: protocol issue: java.lang.Exception : Origin null is not allowed to call this agent

The default Jolokia configuration in ActiveMQ doesn't allow the Cross-Origin Resource Sharing (CORS) method. You can disable this method by editing the jolokia-access.xml file and remove the tag <strict-checking/>:

<cors>
<strict-checking/>
</cors>

Restart your ActiveMQ server afterwards for the changes to be applied.