Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

JBOSS (EAP 7.1.0) JMX Attributes disappear while running jmxtrans-agent #121

@fwelland

Description

@fwelland

I am kicking the tires on JMXTrans-agent and so far it works well for normal JVM stats collection (heap, threads, etc) monitoring for a JBOSS EAP 7.1.0 instance.

I have now tried to add in simple attribute data collection for a JBOSS datasource/pool. JBOSS seems configured correctly, as when I run JMC or VisualVM (local to jboss process) I can navigate to mbeans and interrogate attributes and so on. Here is the problem(s):

When I 'turn-on' JMXTrans-agent; all the jboss specific mbeans disappear from JMC/VisualVM; vanilla JVM level stuff is still there. Ok, no problem, maybe that is how JMXTrans-agent works: I'll turn it off, get the MBEAN names I need from JMC; put that in my jmxtrans-agent.xml and re-enable JMXTrans-agent.

Well that didn't work as JMXTrans-agent wasn't spitting out any data for the jboss mbeans. So I found this switch -Dorg.jmxtrans.agent.JmxTransAgent.diagnostic=true. I restarted with that in place and then I found out that ManagementFactory.getPlatformMBeanServer().queryMBeans(null, null) was not including the root mbeans I was interested in -- just like when using JMC/VisualVM couldn't see the mbeans while JMXTrans-agent was active.

It is like when I run JMXTrans-agent; all the jboss specific mbeans are gone!

Is there anything I can do about this?

NOTE: I have tried this same thing on jboss-eap 7.0.8 and jboss-eap-6.4.18 and they have same exact behavior. I haven't tried any of the wildflys yet; but EAP's 7x and Wildflys >8 are really really similar; I'd suspect Wildfly 10x and 11x to behave the same.

To turn-on JMXTrans-agent; I do:

export JAVA_OPTS="-Xbootclasspath/p:/opt/jboss-eap-7.1.0/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.7.Final-redhat-1.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager  -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager -Dorg.jmxtrans.agent.JmxTransAgent.diagnostic=true  -javaagent:/opt/jmxtrans-agent-1.2.8-SNAPSHOT.jar=/opt/jmxtrans-agent.xml"

/opt/jboss-eap-7.1.0/bin/standalone.sh -b=blah.blah.com   --debug

My jmxtrans-agent.xml looks like:

<jmxtrans-agent>
    <queries>

<!-- OS 
        <query objectName="java.lang:type=OperatingSystem" attribute="SystemLoadAverage" resultAlias="os.systemLoadAverage"/>

-->
        <!-- JVM -->
        <query objectName="java.lang:type=Memory" attribute="HeapMemoryUsage" key="used" resultAlias="toad"/>
        <query objectName="java.lang:type=Memory" attribute="HeapMemoryUsage" key="committed" resultAlias="jvm.heapMemoryUsage.committed"/>
        <query objectName="java.lang:type=Memory" attribute="NonHeapMemoryUsage" key="used" resultAlias="jvm.nonHeapMemoryUsage.used"/>
        <query objectName="java.lang:type=Memory" attribute="NonHeapMemoryUsage" key="committed" resultAlias="jvm.nonHeapMemoryUsage.committed"/>
        <query objectName="java.lang:type=ClassLoading" attribute="LoadedClassCount" resultAlias="jvm.loadedClasses"/>
        <query objectName="java.lang:type=Threading" attribute="ThreadCount" resultAlias="jvm.thread"/>
<!--
        <query objectName="jboss.as.datasources.OracleDS.pool" attribute="ActiveCount" resultAlias="Active.Pool.Count"/>

attribute="MaxUsedCount" resultAlias="MaxUsedCount"

-->
        <query objectName="jboss.as:subsystem=datasources,xa-data-source=OracleDS,statistics=pool" attribute="MaxUsedCount" />
        <query objectName="jboss.as:subsystem=datasources,xa-data-source=OracleDS,statistics=pool" attribute="AvailableCount" resultAlias="foo"/>
        <query objectName="jboss.as.expr:xa-data-source=OracleDS,statistics=pool" attribute="AvailableCount" resultAlias="foo"/>
    </queries>


<!--
	<outputWriter class="org.jmxtrans.agent.ConsoleOutputWriter" />
--> 


    <outputWriter class="org.jmxtrans.agent.RollingFileOutputWriter">
	<fileName>/opt/jbossstats.log</fileName>
        <enabled>true</enabled>
        <maxFileSize>500</maxFileSize>
        <maxBackupIndex>4</maxBackupIndex>
	<singleLine>true</singleLine>
    </outputWriter>
    <collectIntervalInSeconds>11</collectIntervalInSeconds>
</jmxtrans-agent>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions