On 05/09/2011 05:15 PM, David A. Webster wrote:
>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.
Yep, that's my impression too. I'm pretty sure we currently don't
have any once in there for discovering and managing external JVMs
that don't have JMX Remoting enabled (aside from JBoss AS JVMs as
discussed below).
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
I'm not familiar with the Attach API. Is it only possible to attach
to processes owned by the same user? Also, what would you use as the
JVM Resource's key for a JVM discovered via Attach? You wouldn't
want to use the PID right, since it would change if the JVM was
restarted. Perhaps the java.home dir?
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?
For the AS4 and AS5 plugins, we actually use the the JBoss JNP
protocol for obtaining the reference to the remote MBeanServer, so
JMX Remoting isn't required, but it is required that JBoss is
configured to expose its MBeanServer remotely via JNP. What happens
is the PROCESS_FILTERS code in JMXDiscoveryComponent prevents JBoss
JVMs from being discovered by that discovery component, so they can
instead be discovered by EmbeddedJMXServerDiscoveryComponent, which
essentially piggybacks on the JMX connection that was discovered by
the AS4 or AS5 plugin.