VMware Cloud Community
Sudhir_hyperic
Contributor
Contributor

Monitoring JMX service

I have an MBeanServer running using mx4j and have a number of MBeans registered in it. I'm trying out HQ for the first time and after going thru the documentation have questions about how to connect to this JMX app and start monitoring it ? I know that there is a plugin out there but I want to know more information about where to start and what to change in order for me to connect to this MBeanServer. I have the agent running on the machine where the JMX MBeanServer is running. Thanks for all the responses
0 Kudos
11 Replies
staceyeschneide
Hot Shot
Hot Shot

Hi Sudhir,

You may want to check out the following resources to get you started:
http://support.hyperic.com/confluence/display/DOCSHQ30/JMX+Plugin
or for more information on building your custom plugin, look at http://support.hyperic.com/confluence/display/DOCSHQ30/Plugin+Development+Center

HTH,
-Stacey
0 Kudos
BC_hyperic
Enthusiast
Enthusiast

Hi Sudhir,

I am also new to HQ. My company needs to monitor our JMX programs, as a result I have asked quite a few questions about plugins and JMX.

Two threads which you might find helpful are:
http://communities.vmware.com/thread/346281?tstart=0
http://communities.vmware.com/thread/348057?tstart=0

Bob
0 Kudos
Sudhir_hyperic
Contributor
Contributor

Thanks BC and Stacey for the valueble inputs

I know that I need to configure a plugin and when I did that and try to test it its not printing anything. Given below is the plugin that I have

<plugin name="jmx" package="org.hyperic.hq.product.jmx">

<classpath>
<include name="pdk/lib/mx4j"/>
</classpath>

<config name="jmx" type="global">
<option name="jmx.url"
description="JMX URL to MBeanServer"
default="service:jmx:rmi:///jndi/rmi://<unixmachine>:9000/jmxconnector"/>

<option name="jmx.username"
description="JMX username"
optional="true"
default="user"/>

<option name="jmx.password"

<option name="jmx.password"
description="JMX password"
optional="true"
default="pass"
type="secret"/>
</config>

<service name="MyTest"
server="Sun JVM" version="1.5">


<property name="OBJECT_NAME"
value="CONTROL:Name=MyTest|1_0_0|<unixmachinename>"/>

<plugin type="autoinventory"/>

<metric name="AppName"
template="${OBJECT_NAME}:appName"
indicator="true"/>
<metric name="AppVersion"
template="${OBJECT_NAME}:appVersion"
indicator="true"/>
<metric name="HostName"
template="${OBJECT_NAME}:hostName"
indicator="true"/>

</service>

</plugin>

./jre/bin/java -jar pdk/lib/hq-product.jar -p jmx -t "Sun JVM 1.5 MyTest" -m discover -a metric

This does not print anything. Also once I have the plugin ready what are my next steps ? do i need to configure the Sun Server JVM via the HQ UI ? li'l confused about why there is a plugin and then why we need to configure the Sun Server JVM in the UI


Thanks,
Sudhir
0 Kudos
Sudhir_hyperic
Contributor
Contributor

When i try to create a new server of type Sun JVM 1.5 and change its configuration settings seem to be getting the error below. Tried to restart the server but no effect. Any pointers ?


java.rmi.ServerException: EJBException:; nested exception is: javax.ejb.EJBException: RuntimeException; CausedByException is: null at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:196) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624) at org.jboss.ejb.Container.invoke(Container.java:873) at sun.reflect.GeneratedMethodAccessor228.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155) at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104) at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165) at org.hyperic.hq.application.HQApp$Snatcher.invokeProxyNext(HQApp.java:135) at org.hyperic.txsnatch.ProxySnatch.invoke(ProxySnatch.java:37) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46) at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55) at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86) at $Proxy234.getConfigSchema(Unknown Source) at
0 Kudos
Sudhir_hyperic
Contributor
Contributor

I finally could use the standalone plugin invoker to invoke the plugin that I configured and get the following error when displaying the value to the stdout. I'm not sure why its trying to convert the value of the metric to a double, is there anyway to stop this ? Appreciate all your responses

getValue failed for metric: JMX Server MyTest:CONTROL:Name=MyTest|1_0_0|xsdsvc01:AppName:jmx.url=service%3Ajmx%3Armi%3A///jndi/rmi%3A//xsdsvc01%3A9196/jmxconnector,jmx.username=fwadmin,jmx.password=fwadmin
PluginException: Cannot convert 'MyTest' to double
0 Kudos
admin
Immortal
Immortal

All metric values are interpreted as doubles in HQ.

Charles


0 Kudos
Sudhir_hyperic
Contributor
Contributor

Clee,
Thanks for the response but is there a way that I could stop this ? is there a way that I can display the properties of an MBean using the plugin and not the metrics as such. I'm trying to use the plugin invoker for this and have'nt seen anything out there that can achieve what I'm looking for.
0 Kudos
admin
Immortal
Immortal

I think what you are talking about is a property value that is not
stored historically. This is supported through a concept called
"Custom Properties" whereby a resource has some properties whose
values come from the plugin. The property values are displayed near
the masthead in the UI. For example, a platform has such properties
as OS Version, Vendor, Architecture, etc. See the following section
in the JMX plugin documentation:

http://support.hyperic.com/confluence/display/DOCSHQ30/JMX
+Plugin#JMXPlugin-CustomProperties

Charles



0 Kudos
Sudhir_hyperic
Contributor
Contributor

I keep getting this error when configuring the server from the HQ UI. This is after I enter all the values for the jmxserviceURL and jmxUser and jmxPassword,I'm not sure why its picking up the object name java.lang:type=Threading from my plugin since I don't have anything by that name there. Any clues ?

This resource is turned off or has not been configured properly.
The problem is: Invalid configuration: Error retrieving value: ObjectName not found [java.lang:type=Threading]: javax.management.InstanceNotFoundException: MBeanServer cannot find MBean with ObjectName java.lang:type=Threading
Please turn on the server, or fix its Configuration Properties.
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee

The "Sun JVM 1.5" server type requires the server you're monitoring to be running JRE version 1.5 or higher, where these MBeans are part of the standard runtime. What version is your server running?
0 Kudos
jkstraw
Contributor
Contributor

Has there been any movement on this topic?

I too am getting the error "Invalid configuration: Error retrieving value: ObjectName not found [java.lang:type=Threading]: javax.management.InstanceNotFoundException: MBeanServer cannot find MBean with ObjectName java.lang:type=Threading"

I have 18 JVM's on 3 servers (6x3). All of the configuration are identical with the exception on IP address and port number. Hyperic was able to add 3/18 servers perfectly. I also tested the availability of the threading object by connecting to all 18 JVm's via jconsole. No issues from jconsole.

Any ideas?
0 Kudos