Modify the JMX Connection Factory to allow fully customized URLs.

Description

There is a requirement to connect through JMX to a WAS 8.5.5.5 app server (IBM WebSphere 8.5), in order to monitor and collect data from it.

According with the following link, the JMX URL has to be built on a certain way:

http://www.monitis.com/blog/configuring-jmx-in-websphere-8-5/

The following script works to successfully connect through JMX using JConsole:

HOST=10.0.0.1 # Change this as needed PORT=9100 CLASSPATH=$JAVA_HOME/lib/jconsole.jar CLASSPATH=$CLASSPATH:$WAS_HOME/runtimes/com.ibm.ws.admin.client_8.5.0.jar CLASSPATH=$CLASSPATH:$WAS_HOME/runtimes/com.ibm.ws.ejb.thinclient_8.5.0.jar CLASSPATH=$CLASSPATH:$WAS_HOME/runtimes/com.ibm.ws.orb_8.5.0.jar $JAVA_HOME/bin/jconsole \ -J-Djava.class.path=$CLASSPATH\ -J$CLIENTSAS\ -J$CLIENTSSL\ service:jmx:iiop://$HOST:$PORT/jndi/JMXConnector

As you can see, certain custom JARs are required in order to perform the JMX connection.

We have to evaluate the impact of adding those JARs to $OPENNMS_HOME/lib, in order to understand the implications and the consequences of this, besides fixing the URL limitation issues.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Markus von Rüden April 26, 2017 at 6:24 AM
Edited

A url parameter in the Jsr160Collector can now be defined.
The old parameters are still supported but are considered legacy mode and should not be used anymore.
The ip address of the node where the service should be collected can be substituted using ${ipaddr} in the url value.
In addition the Jsr160Collector has now the same capability of the SecuredJmxCollector (factory = SASL).
In general the Jsr160Collector should now be used in all cases when JMX collection is required, e.g. for jboss, websphere, wildfly, etc.

<service name="OpenNMS-JVM" interval="300000" user-defined="false" status="on"> <parameter key="url" value="service:jmx:rmi:///jndi/rmi://${ipaddr}:18980/jmxrmi"/> <parameter key="username" value="jmx"/> <parameter key="password" value="0penNM$rules!"/> <parameter key="retry" value="2"/> <parameter key="timeout" value="3000"/> <parameter key="rrd-base-name" value="java"/> <parameter key="collection" value="jsr160"/> <parameter key="thresholding-enabled" value="true"/> <parameter key="ds-name" value="opennms-jvm"/> <parameter key="friendly-name" value="opennms-jvm"/> </service>

The PR is here: https://github.com/OpenNMS/opennms/pull/1458

Michael Batz November 8, 2016 at 2:07 PM

That would be a very nice solution.

Alejandro Galue November 8, 2016 at 12:47 PM

We can define a set of placeholders (like we have for the JDBC Monitor and Collector), in order to replace these placeholders with the IP of the JMX server and port (I don't think we need something else initially).

For example, we have have something similar, for example:

<service name="PostgreSQL" interval="300000" user-defined="false" status="on"> <parameter key="collection" value="PostgreSQL"/> <parameter key="thresholding-enabled" value="true"/> <parameter key="driver" value="org.postgresql.Driver"/> <parameter key="user" value="postgres"/> <parameter key="password" value="postgres"/> <parameter key="url" value="jdbc:postgresql://OPENNMS_JDBC_HOSTNAME:5432/opennms"/> </service>

As you can see, we're specifying the full JDBC URL with a place holder that will be replaced at runtime with the IP associated with the service in question.

For JMX, we can do something similar:

<service name="OpenNMS-JVM" interval="300000" user-defined="false" status="on"> <parameter key="url" value="service:jmx:rmi:///jndi/rmi://OPENNMS_JMX_IP:18980/jmxrmi"/> <parameter key="username" value="jmx"/> <parameter key="password" value="0penNM$rules!"/> <parameter key="retry" value="2"/> <parameter key="timeout" value="3000"/> <parameter key="rrd-base-name" value="java"/> <parameter key="collection" value="jsr160"/> <parameter key="thresholding-enabled" value="true"/> <parameter key="ds-name" value="opennms-jvm"/> <parameter key="friendly-name" value="opennms-jvm"/> </service>

Michael Batz October 12, 2016 at 12:57 PM

Michael Batz October 12, 2016 at 12:55 PM

I also have a similar issue with monitoring a JBoss server with JMX. You also need to add own jar files in an specific version for a specific JBoss version. It would be nice to have the URL fully configurable and not to include any jar files in $OPENNMS_HOME/lib by default. So everybody can add the jar files in the required version for their own, like adding JDBC drivers for the JdbcMonitor or JdbcCollector.

Fixed

Details

Assignee

Reporter

Labels

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created October 12, 2016 at 12:12 PM
Updated May 8, 2017 at 10:09 AM
Resolved May 8, 2017 at 10:09 AM

Flag notifications