>>> 2)  Ability to attach to a local JVM's MBean server without the need for a JMX remoting.  We have written a new Generic JMX plugin that makes use of the Java Attach API to enable the RHQ agent to discover JVMs that are not exposed via JMX remoting.  These JVMs must be running under the same OS user account as the agent.  This is critical to large enterprise operations that do not want to manage hundreds or thousands of JVM JMX ports and all the security implications that entails.  This will also allow us to use JON/RHQ to manage our vast array of Stand Alone Java process.  I have code I would like to submit that demonstrates this.  The idea is that it should, most likely, be rolled into the standard Generic JMX plugin
>> This may already be doable:
>>
>>                 /*
>>                   * We'll connect to the discovered VM on the local host, so set the jmx connection
>>                   * properties accordingly. This may only work on JDK6+, but then JDK5 is deprecated
>>                   * anyway.
>>                   */
>>                  pluginConfiguration.put(new PropertySimple(JMXDiscoveryComponent.COMMAND_LINE_CONFIG_PROPERTY,
>>                          javaClazz));
>>                  pluginConfiguration.put(new PropertySimple(JMXDiscoveryComponent.CONNECTION_TYPE,
>>                      LocalVMTypeDescriptor.class.getName()));
>>
>> This is how I do it in the (currently very basic) hadoop plugin (see
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=blob_plain;f=modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceDiscovery.java;hb=HEAD )

>I thought the LocalVMTypeDescriptor conn type was for when the managed
JMX server was inside the same process as the RHQ plugin container, at
least that seems to be what the code in
InternalJMXServerDiscoveryComponent suggests.


I believe this is so for the Agent to discover it's own JVM.  But with JON 2.4 the agent will not discover any JVM running on the same node that is not using JMX Remoting....  The code is a bit confusing, but it appears to discover "itself" using the Attach API or some similar Sun API, but not for discovering other JVM processes running on the same node under the same Agent.  I will attach code in Bug tracking system later showing what we did and you guys can determine if that something is already there in 4.0 that accomplishes this, and I have just not found it yet.

Bottom line is the agent should be able to see every JVM running on the node under the same account, regardless of whether or not JMX remoting is enabled, attach to its MBean server and expose every registered MBean, its attributes and operations, found there on each JVM, and report it all back to the JON server for inventory management.  

Same should go for Tomcat.  Shouldn't need to have jmx remoting enabled to see Tomcat instances.  Oddly, it appears JBoss EAP/EWP doesn't need jmx remoting for those to be discovered....wondering if they use the Attach API or something similar in those plugins?


David Webster
Union Pacific Railroad
Lead Architect-Web Infrastructure
Systems Engineering
Phone: (402) 544-1094 | Email: dawebster@up.com