Announcement Announcement Module
No announcement yet.
Can Hyperic auto-detect MBeans without Instrumented Spring? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can Hyperic auto-detect MBeans without Instrumented Spring?

    I'm successfully running Hyperic Open Source to monitor a webapp running on Apache Tomcat 6.0.16.

    I have exported a custom component of my webapp to JMX as described here, and it shows up in JConsole as expected.

    public class MyClass {
      @ManagedMetric(category="utilization", displayName="Message Queue Size", 
        description="The size of the Message Queue", 
        metricType = MetricType.COUNTER, unit="messages")
      public int getQueueSize(){
    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
      <property name="autodetect" value="true" />
      <property name="assembler" ref="assembler" />
      <property name="namingStrategy" ref="namingStrategy" />
    <bean id="attributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource" />
    <bean id="assembler" class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
      <property name="attributeSource" ref="attributeSource"/>
    <bean id="namingStrategy" class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
      <property name="attributeSource" ref="attributeSource" />
    Now is it at all possible to have Hyperic auto-detect this bean without using the Instrumented Spring Framework jars in my webapp? I wouldn't mind building a custom Hyperic plugin if necessary.


  • #2
    It turns out my setup was basically correct (as documented here).

    The Linux server showed up in Hyperic's Auto-Discovery panel, but the tomcat containing my application with the new metric was not listed underneath (instead, other instances of tomcat were shown, which I did not want monitored). That's why I didn't klick "Add to inventory" initially. Only when I did so out of desperation, the new metric showed up.

    So it's not quite intuitive, but at least it's possible.


    • #3
      I'm having the same problem as the previous poster (dan.baumann), and haven't found a solution yet. I'm evaluating HQ Version (build #1284 - Mar 24, 2010 - Release Build), in conjunction with a simple webapp built with Spring Framework 3.0.1.RELEASE. I've tried deploying the webapp in SpringSource tc Server as well as in Tomcat 6.0.26, with the same result in each case; Hyperic autodiscovers the servlet container but doesn't show my custom MBeans.

      I'm trying to get Hyperic to auto-discover some custom MBeans in my webapp (see code below). I followed the same procedure as dan.baumann, using the steps shown here. My custom MBeans show up fine in JConsole, but I can't get Hyperic to discover them.

      My webapp is built with standard Spring 3.0.1, not instrumented Spring.

      @ManagedResource(objectName = "spring.application:application=eservices, type=ResourcePool, name=httpClientPoolImpl",
              description = "HTTP Client Pool")
      public class HttpClientPoolImpl implements HttpClientPool {
      @ManagedMetric(category = "utilization", displayName = "Number of clients available",
                  description = "The number of HTTP clients available in the pool",
                  metricType = MetricType.GAUGE, unit = "none")
          public synchronized int getNumberOfClientsAvailable() {
              return clientsAvailable;
      The following extract from the Hyperic agent's logfile shows that the autodiscoverer is throwing a NullPointerException:

      2010-06-08 15:59:28,304 INFO  [Thread-2] [RuntimeAutodiscoverer] Running runtime autodiscovery for SpringSource tc Runtime 6.0
      2010-06-08 15:59:28,344 ERROR [Thread-2] [RuntimeAutodiscoverer] Unexpected error running autodiscoverer for plugin: SpringSource
              at java.util.Hashtable.put(
              at org.hyperic.hq.product.PluginUpdater.addProperties(
              at org.hyperic.hq.product.PluginUpdater.updatePluginData(
              at org.hyperic.hq.product.PluginUpdater.updateServiceTypes(
              at org.hyperic.hq.product.ServerDetector.discoverResources(
              at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan_internal(
              at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan(
              at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(
              at org.hyperic.hq.autoinventory.ScanManager.access$000(
      I'd really appreciate some help. Presumably the NullPointerException means there is a bug in Hyperic? But I don't know if it is this bug that is preventing the auto-discovery.



      • #4
        Just to be clear: The setup described above did actually work for me, it's just that the servlet container hosting my custom metric did not show up in the austodiscovery panel.


        • #5
          Originally posted by dan.baumann View Post
          Just to be clear: The setup described above did actually work for me, it's just that the servlet container hosting my custom metric did not show up in the austodiscovery panel.
          Thanks for the prompt reply, Dan!

          Where did the new metric show up? As a service in the "Services" panel of the "Resources -> Inventory" tab? And what was the name of the service according to HQ? (I presume it was prepended with the name of the Linux server). If you had multiple metrics, did each show up as a separate service?

          Thanks for your help!


          • #6
            I used a single metric only ("Counter size"), and it looks like this.


            • #7
              Thanks Dan, I tried a few more times and eventually the custom metrics did show up. I'm not sure why they didn't show up the first time.


              • #8
                Same here, basically. If you ever find out why this is so, please let me know.


                • #9
                  Hi Guys,

                  I am struggling to display my Spring custom metrics in Hyperic but could not succeed till now.

                  I had already logged a thread on this


                  Can anyone of you please let me know what I am missing.

                  Thanks a lot.

                  Best Regards - Roy