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.

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

Twitter: @schneider_chris

Github: cschneider

Xing

Linkedin

Popular Labels

My colleagues at Talend

Talend Community Coders





  • No labels