JmxAggregator

Skip to end of metadata
Go to start of metadata

Aggregates JMX information from local java processes into a REST service and offers configuration generation for nagios.

Full Size
A Gliffy Diagram named: jmx-aggregator

Autodetection

Autodetects running processes and uses auto discovery plugins to detect what resources are available in these processes.

Currently autodection supports:

  • ActiveMQ: Broker, Queues, Topics
  • Camel: Context, Routes
  • CXF: Endpoints
  • Karaf: Features
  • Tomcat7: WebModules

Simple XML Output

Plugins extract selected mbeans into an easy to understand structure.

<?xml version="1.0" encoding="UTF-8"?>
<ns2:host xmlns:ns2="http://talend.org/monitoring">
  <process name="ActiveMQ" href="...">
    <instance type="ActiveMQ" name="localhost">
      <resource name="localhost" oName="..." href="..."/>
      <resources name="Queue">
        <resource name="example.A" oName="..." href="...">
          <attr name="ConsumerCount" value="1" href="..."/>
          <attr name="QueueSize" value="99" href="..."/>
        </resource>
      </resources>
    </instance>
  </process>
</ns2:host>

Fetching any mbean attribute

Besides the listed beans and attributes JMXAggregator allows to read any mbean and attribute with simple types.

The URL below fetches the current queue size of the queue myqueue from the ActiveMQ process.

http://localhost:8080/cxf/jmx-aggregator/process/ActiveMQ/resource/org.apache.activemq%3ABrokerName%3Dlocalhost%2CDestination%3Dmyqueue%2CType%3DQueue/QueueSize

Filtering

The administrator can provide a xsl style sheet to filter the for the attributes he wants to have in the nagios config. The line below selects the failed and completed exchanges from camel routes

 <xsl:template match="attr[../../@name='Route' and (@name='ExchangesFailed' or @name='ExchangesCompleted')]"><xsl:copy-of select="."/></xsl:template>

Configuration generation

The filtered xml is used to generate nagios configs. These are available from the rest service and can be copied to nagios using wget:

> wget -Omyhost.cfg localhost:8080/cxf/jmx-aggregator/process/all/config
> /etc/init.d/nagios3 restart

The nagios configs contain one service config for each attribute:

define service {
	use generic-service
	host_name localhost
	service_description Camel-sopwin58/181-camel-3-Route-route1-ExchangesFailed
	check_command check_http_metric!0!0!http://localhost:8080/cxf/jmx-aggregator/process/karaf-root
/resource/org.apache.camel%3Acontext%3Dsopwin58%2F181-camel-3%2Cname%3D%22route1%22%2Ctype%3Droutes/ExchangesFailed
}

Contact

mail: chris_at_die-schneider.net

Subscribe

RSS Feed

Follow me on twitter: @schneider_chris

Popular Labels

My colleagues at Talend

Talend Community Coders

Blog Archive

  1. 2013
    1. February
  2. 2012
    1. November
    2. July
    3. April
    4. March
    5. January
  3. 2011
    1. December
    2. November
    3. October
    4. September
    5. August
    6. June
    7. May
    8. April
    9. February
    10. January
  4. 2010
    1. September
    2. June
    3. February
  5. 2009
    1. September
  6. 2008
    1. December
    2. October
    3. September
    4. August




Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.