Re: JMXTrans Weblogic Support

402 views
Skip to first unread message

Jon Stevens

unread,
Oct 30, 2011, 1:43:02 PM10/30/11
to Eric VIALLE, jmxt...@googlegroups.com
Hi Eric,

Ok, I've integrated a slightly different set of code. Basically, I
added a field to server called protocolProviderPackages. You just need
to put "weblogic.management.remote" into that field. I then key off
that in order to setup the environment correctly. I also cleaned up
getUrl to make sure that you can set your own url. This should give
you the flexibility you need without needing to add a jvmtype to the
Server object.

To build a new jar file, just type: 'ant jar-all'

Let me know.

jon


On Sun, Oct 30, 2011 at 6:15 AM, Eric VIALLE <er...@vialle.org> wrote:
> Hello Jon,
> I would use JMXTrans with a Weblogic cluster.
> The problem is that JMXTrans can't be connected to "those kind of JVMs"...
>
> I- How it works
> So based on this
> article http://download.oracle.com/docs/cd/E13222_01/wls/docs90/jmx/accessWLS.html, I
> added a new setting to Server configuration: jvmType (see attached patch)
> I-1- Java part
> The jvmType could have two values:
> - standard
> - weblogic
> if the value is standard, the jmx connection will be used as you made it
> If the value is weblogic, the jmxconnection will use a special
> environnement. (see getWeblogicEnvironment() )
> I-2- Classpath
> The following path should be added to the classpath:
> WL_HOME\lib\wljmxclient.jar
> II- Test
> I didn't test it fully, because i have two problems:
> - In SignalInterceptor, I can't
> import sun.misc.Signal, sun.misc.SignalHandler
> - I don't know how to build that project (I'm a maven guy basically)
>
>
> Feel free to contact for more info (gtalk: eric....@gmail.com)
> Regards,
> Eric Vialle
>
>

Eric Vialle

unread,
Nov 3, 2011, 5:25:17 PM11/3/11
to jmxtrans
On 30 oct, 18:43, Jon Stevens <latch...@gmail.com> wrote:
> Let me know.

That works successfully. BUT I had to modify the jmxtrans.sh script:

EXEC=${EXEC:-"-classpath $JAR_FILE:/apps/WebLogic/10.3.2/
AppServer/server/lib/wljmxclient.jar
com.googlecode.jmxtrans.JmxTransformer -e -j $JSON_DIR -s
$SECONDS_BETWEEN_RUNS"}

Why don't you modify this script like this:

ADDITIONAL_CP=""
EXEC=${EXEC:-"-classpath $JAR_FILE:/$ADDITIONAL_CP
com.googlecode.jmxtrans.JmxTransformer -e -j $JSON_DIR -s
$SECONDS_BETWEEN_RUNS"}

Henri Gomez

unread,
Nov 4, 2011, 5:29:23 AM11/4/11
to jmxt...@googlegroups.com
2011/11/3 Eric Vialle <eric....@gmail.com>:

This one ?

### Eclipse Workspace Patch 1.0
#P jmxtrans
Index: jmxtrans.sh
===================================================================
--- jmxtrans.sh (revision 250)
+++ jmxtrans.sh (working copy)
@@ -27,7 +27,7 @@
JMX_PORT=${JMX_PORT:-"2101"}
LOG_LEVEL=${LOG_LEVEL:-"debug"}
JMXTRANS_OPTS="$JMXTRANS_OPTS -Djmxtrans.log.level=${LOG_LEVEL}"
-
+ADDITIONAL_CP=${ADDITIONAL_CP:""}

MONITOR_OPTS=${MONITOR_OPTS:-"-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=${JMX_PORT}"}
GC_OPTS=${GC_OPTS:-"-Xms${HEAP_SIZE}M -Xmx${HEAP_SIZE}M
-XX:+UseConcMarkSweepGC -XX:NewRatio=${NEW_RATIO}
-XX:NewSize=${NEW_SIZE}m -XX:MaxNewSize=${NEW_SIZE}m
-XX:MaxTenuringThreshold=16 -XX:GCTimeRatio=9
-XX:PermSize=${PERM_SIZE}m -XX:MaxPermSize=${MAX_PERM_SIZE}m
-XX:+UseTLAB -XX:CMSInitiatingOccupancyFraction=${IO_FRACTION}
-XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing
-XX:ParallelGCThreads=${CPU_CORES}
-Dsun.rmi.dgc.server.gcInterval=28800000
-Dsun.rmi.dgc.client.gcInterval=28800000"}
@@ -59,9 +59,9 @@
fi

if [ -z "$FILENAME" ]; then
- EXEC=${EXEC:-"-jar $JAR_FILE -e -j $JSON_DIR -s $SECONDS_BETWEEN_RUNS"}
+ EXEC=${EXEC:-"-jar $JAR_FILE:$ADDITIONAL_CP -e -j $JSON_DIR
-s $SECONDS_BETWEEN_RUNS"}
else
- EXEC=${EXEC:-"-jar $JAR_FILE -e -f $FILENAME -s $SECONDS_BETWEEN_RUNS"}
+ EXEC=${EXEC:-"-jar $JAR_FILE:$ADDITIONAL_CP -e -f $FILENAME
-s $SECONDS_BETWEEN_RUNS"}
fi

$JAVA -server $JAVA_OPTS $JMXTRANS_OPTS $GC_OPTS $MONITOR_OPTS $EXEC 2>&1 &

Henri Gomez

unread,
Nov 4, 2011, 3:30:07 PM11/4/11
to jmxt...@googlegroups.com
thanks to comment provided patch.

If everyone agree, I'll commit it and may prepare a new release including it.

Cheers


2011/11/4 Henri Gomez <henri...@gmail.com>:

Jon Stevens

unread,
Nov 4, 2011, 3:46:37 PM11/4/11
to jmxt...@googlegroups.com, jmxt...@googlegroups.com
I'd rather have a different name than additional-cp but I can't think of anything better right now.

Missplet on my ipone

Henri Gomez

unread,
Nov 6, 2011, 5:41:58 AM11/6/11
to jmxt...@googlegroups.com
ADDON_JARS ?

2011/11/4 Jon Stevens <latc...@gmail.com>:

Henri Gomez

unread,
Nov 7, 2011, 2:37:28 AM11/7/11
to jmxt...@googlegroups.com
2011/11/6 Henri Gomez <henri...@gmail.com>:
> ADDON_JARS ?

---


### Eclipse Workspace Patch 1.0
#P jmxtrans
Index: jmxtrans.sh
===================================================================
--- jmxtrans.sh (revision 250)
+++ jmxtrans.sh (working copy)
@@ -27,7 +27,7 @@
JMX_PORT=${JMX_PORT:-"2101"}
LOG_LEVEL=${LOG_LEVEL:-"debug"}
JMXTRANS_OPTS="$JMXTRANS_OPTS -Djmxtrans.log.level=${LOG_LEVEL}"
-

+ADDON_JARS=${ADDON_JARS:""}

MONITOR_OPTS=${MONITOR_OPTS:-"-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=${JMX_PORT}"}
GC_OPTS=${GC_OPTS:-"-Xms${HEAP_SIZE}M -Xmx${HEAP_SIZE}M
-XX:+UseConcMarkSweepGC -XX:NewRatio=${NEW_RATIO}
-XX:NewSize=${NEW_SIZE}m -XX:MaxNewSize=${NEW_SIZE}m
-XX:MaxTenuringThreshold=16 -XX:GCTimeRatio=9
-XX:PermSize=${PERM_SIZE}m -XX:MaxPermSize=${MAX_PERM_SIZE}m
-XX:+UseTLAB -XX:CMSInitiatingOccupancyFraction=${IO_FRACTION}
-XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing
-XX:ParallelGCThreads=${CPU_CORES}
-Dsun.rmi.dgc.server.gcInterval=28800000
-Dsun.rmi.dgc.client.gcInterval=28800000"}
@@ -59,9 +59,9 @@
fi

if [ -z "$FILENAME" ]; then
- EXEC=${EXEC:-"-jar $JAR_FILE -e -j $JSON_DIR -s $SECONDS_BETWEEN_RUNS"}

+ EXEC=${EXEC:-"-jar $JAR_FILE:$ADDON_JARS -e -j $JSON_DIR -s


$SECONDS_BETWEEN_RUNS"}
else
- EXEC=${EXEC:-"-jar $JAR_FILE -e -f $FILENAME -s $SECONDS_BETWEEN_RUNS"}

+ EXEC=${EXEC:-"-jar $JAR_FILE:$ADDON_JARS -e -f $FILENAME -s

Jon Stevens

unread,
Nov 7, 2011, 9:14:12 AM11/7/11
to jmxt...@googlegroups.com
How about prefix_cp and suffix_cp?

Missplet on my ipone

Henri Gomez

unread,
Nov 7, 2011, 10:04:03 AM11/7/11
to jmxt...@googlegroups.com
prefix_cp and suffix_cp ?

Sample ?

2011/11/7 Jon Stevens <latc...@gmail.com>:

Jon Stevens

unread,
Nov 7, 2011, 10:49:01 AM11/7/11
to jmxt...@googlegroups.com, jmxt...@googlegroups.com
Before and after the existing cp. offers more control.

Missplet on my ipone

Henri Gomez

unread,
Nov 7, 2011, 1:04:43 PM11/7/11
to jmxt...@googlegroups.com
> Before and after the existing cp. offers more control.

We could :)

---

--- jmxtrans.sh (revision 250)
+++ jmxtrans.sh (working copy)

@@ -28,6 +28,13 @@


LOG_LEVEL=${LOG_LEVEL:-"debug"}
JMXTRANS_OPTS="$JMXTRANS_OPTS -Djmxtrans.log.level=${LOG_LEVEL}"

+if [ ! -z "$PREFIX_CP" ]; then
+ PREFIX_CP="$PREFIX_CP:"
+fi
+
+if [ ! -z "$POSTFIX_CP" ]; then
+ POSTFIX_CP=":$POSTFIX_CP"
+fi

MONITOR_OPTS=${MONITOR_OPTS:-"-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=${JMX_PORT}"}
GC_OPTS=${GC_OPTS:-"-Xms${HEAP_SIZE}M -Xmx${HEAP_SIZE}M
-XX:+UseConcMarkSweepGC -XX:NewRatio=${NEW_RATIO}
-XX:NewSize=${NEW_SIZE}m -XX:MaxNewSize=${NEW_SIZE}m
-XX:MaxTenuringThreshold=16 -XX:GCTimeRatio=9
-XX:PermSize=${PERM_SIZE}m -XX:MaxPermSize=${MAX_PERM_SIZE}m
-XX:+UseTLAB -XX:CMSInitiatingOccupancyFraction=${IO_FRACTION}
-XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing
-XX:ParallelGCThreads=${CPU_CORES}
-Dsun.rmi.dgc.server.gcInterval=28800000
-Dsun.rmi.dgc.client.gcInterval=28800000"}

@@ -59,9 +66,9 @@
fi

if [ -z "$FILENAME" ]; then
- EXEC=${EXEC:-"-jar $JAR_FILE -e -j $JSON_DIR -s $SECONDS_BETWEEN_RUNS"}

+ EXEC=${EXEC:-"-jar $PREFIX_CP$JAR_FILE$POSTFIX_CP -e -j


$JSON_DIR -s $SECONDS_BETWEEN_RUNS"}
else
- EXEC=${EXEC:-"-jar $JAR_FILE -e -f $FILENAME -s $SECONDS_BETWEEN_RUNS"}

+ EXEC=${EXEC:-"-jar $PREFIX_CP$JAR_FILE$POSTFIX_CP -e -f
$FILENAME -s $SECONDS_BETWEEN_RUNS"}
fi

$JAVA -server $JAVA_OPTS $JMXTRANS_OPTS $GC_OPTS $MONITOR_OPTS $EXEC 2>&1 &

---

BTW, even simpler, defining JAR_FILE in conf file shoud do the trick
isn't it ? :)

JAR_FILE="/mypath/mypre.jar:jmxtrans-all.jar:/mypath/mypost.jar"

And it should works with current release

Jon Stevens

unread,
Nov 7, 2011, 2:30:51 PM11/7/11
to jmxt...@googlegroups.com
use the 'default' bash syntax?

other than that, fine.

jon

Henri Gomez

unread,
Nov 8, 2011, 3:02:48 AM11/8/11
to jmxt...@googlegroups.com
I don't think we need to update jmxtrans.sh script at all since
JAR_FILE defined in jmxtrans.conf could be updated accordingly :

(/etc/sysconfig/jmxtrans or /etc/default/jmxtrans) :

JAR_FILE=/usr/share/jmxtrans/jmxtrans-all.jar

-->

JAR_FILE=/usr/share/jmxtrans/jmxtrans-all.jar:/apps/WebLogic/10.3.2/AppServer/server/lib/wljmxclient.jar

so it won't over complicated configuration with PRE/POST PREFIX :)

Jon Stevens

unread,
Nov 8, 2011, 9:45:41 AM11/8/11
to jmxt...@googlegroups.com, jmxt...@googlegroups.com
Possibly, but then we can never change the path to the jar because it will break people's installs.

Missplet on my ipone

Henri Gomez

unread,
Nov 8, 2011, 10:25:13 AM11/8/11
to jmxt...@googlegroups.com
> Possibly, but then we can never change the path to the jar because it will break people's installs.

I didn't check for DEB, but for RPM, config file is created at the
first RPM install.
It won't be changed when upgrading RPM.

A simple note for admins/users is mandatory BTW, to explain what to do
in very special case like this weblogic one.

Rob Houghton

unread,
Feb 25, 2014, 12:10:40 PM2/25/14
to jmxt...@googlegroups.com
Hi , did this use case get committed to the code base? I did a successful build from Github last week for RPM and installed and running, which is good. I now want to pull in Weblogic runtime Stats. A couple of replies mention documentation is mandatory for the special use case. Did this happen?

Alexandre Liban

unread,
Mar 14, 2014, 10:43:21 AM3/14/14
to jmxt...@googlegroups.com
Hi all. I have the same question.

I am working on a light monitoring solution based on JMXTrans and XML output files displayed with XSL and ChartsJS library. I have already coded the XML outputter, but I have trouble to access to runtime and domainruntime weblogic mbeans with jmxtrans. I can only access to basic JVM components (heap, threads, loaded classes, etc).

Is it possible to put the complete connection URL in json file (like "url" : "service:jmx:rmi:///jndi/iiop://<host>:<port>/weblogic.management.mbeanservers.runtime") ?
How can I add the wljmxclient.jar or wlfullclient.jar to the jmxtrans classpath ?

Thanks !



Alex

Rob Houghton

unread,
Mar 14, 2014, 5:09:50 PM3/14/14
to jmxt...@googlegroups.com
Hi Alex,

I did have this problem, however you can change the WLS configuration so that the com.bea MBean tree is visible over the Standard JMX interface. There's an additional JVM arg which I think achieves this, add -Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder to the JVM startup args along with the normal JMX configuration. i.e. port ssl etc. Also you will probably need to allow anonymous lookups.

Follow the steps in this link and it will work, I'm currently in the middle of exposing all WLS configuration metrics from our production environment using JMXTrans and feeding the outputs into Graphite. 

Alexandre Liban

unread,
Mar 17, 2014, 10:34:47 AM3/17/14
to jmxt...@googlegroups.com
Hi Rob.

Thanks for your answer !

I can know see the runtime mbean tree over the standard JMX interface (which I can explore simply via jconsole <host>:<port>). I can now advance with JMXtrans part. I did know this link and it is my final target.

Thanks again.
Reply all
Reply to author
Forward
0 new messages