Monitoring ActiveMQ

This article will help you get the Activemq plugin for sd-agent configured and returning metrics

Installing the activemq plugin package

Install the activemq plugin on Debian/Ubuntu:

sudo apt-get install sd-agent-activemq

Install the activemq plugin on RHEL/CentOS:

sudo yum install sd-agent-activemq

Read more about agent plugins.

Configuring the agent to monitor Apache ActiveMQ

1. Ensure that JMX Remote is enabled on your ActiveMQ server.

2. Configure /etc/sd-agent/conf.d/activemq.yaml

instances:
instances:
  - host: localhost
    port: 7199
    user: username
    password: password
    name: activemq_instance
# List of metrics to be collected by the integration
# You should not have to modify this.
init_config:
  conf:
    - include:
      Type: Queue
      attribute:
        AverageEnqueueTime:
          alias: activemq.queue.avg_enqueue_time
          metric_type: gauge
        ConsumerCount:
          alias: activemq.queue.consumer_count
          metric_type: gauge
        ProducerCount:
          alias: activemq.queue.producer_count
          metric_type: gauge
        MaxEnqueueTime:
          alias: activemq.queue.max_enqueue_time
          metric_type: gauge
        MinEnqueueTime:
          alias: activemq.queue.min_enqueue_time
          metric_type: gauge
        MemoryPercentUsage:
          alias: activemq.queue.memory_pct
          metric_type: gauge
        QueueSize:
          alias: activemq.queue.size
          metric_type: gauge
        DequeueCount:
          alias: activemq.queue.dequeue_count
          metric_type: counter
        DispatchCount:
          alias: activemq.queue.dispatch_count
          metric_type: counter
        EnqueueCount:
          alias: activemq.queue.enqueue_count
          metric_type: counter
        ExpiredCount:
          alias: activemq.queue.expired_count
          type: counter
        InFlightCount:
          alias: activemq.queue.in_flight_count
          metric_type: counter

    - include:
      Type: Broker
      attribute:
        StorePercentUsage:
          alias: activemq.broker.store_pct
          metric_type: gauge
        TempPercentUsage:
          alias: activemq.broker.temp_pct
          metric_type: gauge
        MemoryPercentUsage:
          alias: activemq.broker.memory_pct
          metric_type: gauge

3. Restart the agent

sudo /etc/init.d/sd-agent restart

or

sudo systemctl restart sd-agent

Verifying the configuration
Execute info to verify the configuration with the following:

sudo /etc/init.d/sd-agent info 

or

/usr/share/python/sd-agent/agent.py info

If the agent has been configured correctly you'll see an output such as:

activemq
-----
  - instance #0 [OK]
  - Collected * metrics

You can also view the metrics returned with the following command:

service sd-agent jmx collect

Configuring graphs

Click the name of your server from the Devices list in your Server Density account then go to the Metrics tab. Click the + Graph button on the right then choose the activemq metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.

Screen_Shot_2018-01-18_at_11.46.12.png

Monitored metrics

Metric Values
activemq.broker.memory_pct

The percentage of memory in use.
percent / None
Type: float
activemq.broker.store_pct

The percentage of store in use.
percent / None
Type: float
activemq.broker.temp_pct

The percentage of temporary in use.
percent / None
Type: float
activemq.queue.avg_enqueue_time

On average the amount of time (ms) that messages remained enqueued.
millisecond / None
Type: float
activemq.queue.consumer_count

The number of consumers connected
None / None
Type: float
activemq.queue.dequeue_count

The amount of messages that remained dequeued.
message / None
Type: float
activemq.queue.dispatch_count

The amount of messages that have been dispatched.
message / None
Type: float
activemq.queue.enqueue_count

The amount of messages that have been enqueued.
message / None
Type: float
activemq.queue.expired_count

The amount of messages that have been expired.
message / None
Type: float
activemq.queue.in_flight_count

The amount of messages that have been in flight.
message / None
Type: float
activemq.queue.max_enqueue_time

The max the amount of time (ms) that messages remained enqueued.
millisecond / None
Type: float
activemq.queue.memory_pct

The percentage of memory currently in use
percent / None
Type: float
activemq.queue.min_enqueue_time

The min the amount of time (ms) that messages remained enqueued.
millisecond / None
Type: float
activemq.queue.producer_count

The number of producers connected
None / None
Type: float
activemq.queue.size

The amount of messages that remained queued.
message / None
Type: float
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.