Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-6589

Can't monitor JBoss EAP 6.1.0 or later with the JMXMonitor/JMXCollector because they don't support jmx-remoting protocol

    XMLWordPrintable

    Details

      Description

      This is related with support ticket 2735:
      https://mynms.opennms.com/Ticket/Display.html?id=2735

      Here is a brief description about the problem and the proposed solution based on customer's input:

      We think we may have a fix for the problems we have been having with JSR160Collector on JBoss EAP 6.1.0 or later.

      Here is the gig: when you try to connect to it using a method (using current code) that jeffg gave us to TRY to connect to a JBoss EAP 6.1.0 server:

      service:jmx:remoting-jmx://IP_ADDRESS_HERE:9999/

      Instead of getting that URI, ONMS gives us a URI of

      service:jmx:remoting-jmx:///jndi/remoting-jmx://IP_ADDRESS_HERE:9999/

      The IP is correct but the extra '/jndi/' is excess content that is causing the connection to fail.

      The following code in org.opennms.protocols.jmx.connectors.JMXSecureConnectionFactory.java needs to be changed from

      // RMI and JMXMP use different URL schemes
      try {
          if (protocol.equalsIgnoreCase("jmxmp")) {
              // Create an JMXMP connector client and
              // connect it to the JMXMP connector server
              //
              url = new JMXServiceURL(protocol, InetAddressUtils.str(address), port, urlPath);
          } else {
              // Fallback, building a URL for RMI
              url = new JMXServiceURL("service:jmx:" + protocol + ":///jndi/" + protocol + "://" + InetAddressUtils.str(address) + ":" + port + urlPath);
      }
      

      To

      // RMI and JMXMP use different URL schemes
      try {
          if (protocol.equalsIgnoreCase("jmxmp") || (protocol.equalsIgnoreCase("remoting-jmx") ) {
              // Create an JMXMP connector client and
              // connect it to the JMXMP connector server
              //
              url = new JMXServiceURL(protocol, InetAddressUtils.str(address), port, urlPath);
          } else {
              // Fallback, building a URL for RMI
              url = new JMXServiceURL("service:jmx:" + protocol + ":///jndi/" + protocol + "://" + InetAddressUtils.str(address) + ":" + port + urlPath);
      }
      

      The customer tried the solution on their environment for several kind of JMX servers besides recent versions of JBoss, and everything is working as expected.

        Attachments

          Activity

            People

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: