יום רביעי, 8 במאי 2013

JMX Connection to Sonic MQ 8.5

For monitoring needs I was requested to set up a JMX connection from jConsole to Progress Sonic MQ 8.5. As far as my eyes can tell, this method will be relevant for previous versions of Sonic MQ, I will perhaps get to test it on 7.5 one day in my qa prod.
According to their overview of this matter;
In order to access Sonic MBeans, the container to be analyzed needs no special setup or
libraries. Some Sonic libraries must be on the JMX console’s classpath:
● mgmt_client.jar
● sonic_Client.jar
If the container is hosting a SonicMQ broker, the following library must also be on the
JMX console’s classpath:
● sonic_mgmt_client.jar
that means that if you want to initiate the connection from a remote computer you have to take 2 prerequisites in mind:
  1. Network: Make sure tcp port used for the containers on both sides is open
  2. Java Classes: you will have to have all three jars from Sonic MQ installation and copy them to the remote computer running the JMX client.
If you plan on initiating this connection locally, just make sure you have your paths straight as they will come in handy when running the JMX client.
The example brought from Progress documentation is referring to a Windows version of jConsole:
1. As JConsole is packaged with Sun 1.5 and newer Java Development Kits (JDKs),
install a JDK on the system where the JConsole will run. In this example, the JDK is
installed at C:\jdk1.6.0_11.
2. Copy or install the required libraries onto the local system. In this example, the Sonic
Domain Manager (which includes the required libraries) is installed at
C:\Program Files\Progress\Sonic on the same system where JConsole will run.
3. Start the Sonic management container; in this example, Domain1.DomainManager.Progress SonicMQ Configuration and Management Guide 8.5 643
Using JConsole to Examine a Sonic Domain Manager
4. Enter (as one line):
C:\jdk1.6.0_11\bin\java.exe \
-Djmx.remote.protocol.provider.pkgs=com.sonicsw.jmx.remote.protocol \
-cp C:\jdk1.6.0_11\lib\tools.jar;
C:\jdk1.6.0_11\lib\jconsole.jar;
C:\Program Files\Progress\Sonic\MQ8.0\lib\sonic_mgmt_client.jar;
C:\Program Files\Progress\Sonic\MQ8.0\lib\mgmt_client.jar;
C:\Program Files\Progress\Sonic\MQ8.0\lib\sonic_Client.jar \
sun.tools.jconsole.JConsole
5. In the Java Monitoring & Management Console window, the New Connection dialog
box lets you define the connection:
On the local system, you could choose the process identifier (PID) to make the
connection. For remote systems, use the syntax:
service:jmx:sonic+tcp://host:port/domain.container
where:
● host – hostname (or localhost)
● port – the broker TCP port accepting connections
● domain – the container’s Sonic domain name
● container – the container’s Sonic container name
For this example, the Remote Process entry would be:
service:jmx:sonic+tcp://localhost:25193/Domain1.DomainManager
In order to adapt this command to linux (OpenSuse 11.0) I merely changed the java syntax and that’s what I got:
/usr/java/default/bin/java -Djmx.remote.protocol.provider.pkgs=com.sonicsw.jmx.remote.protocol -cp /usr/java/default/lib/tools.jar:/usr/java/default/lib/jconsole.jar:/home/user/installations/progress/sonic/MQ8.5/lib/sonic_mgmt_client.jar:/home/user/installations/progress/sonic/MQ8.5/lib/mgmt_client.jar:/home/user/installations/progress/sonic/MQ8.5/lib/sonic_Client.jar:: sun.tools.jconsole.JConsole
NOTICE: You can not connect to Sonic MQ JMX through the VM PID, so you will have to use the complete url format as suggested before: service:jmx:sonic+tcp://localhost:2506/DomainContainer
hopefully this will save you the time I had to put into this matter. Would love to hear if you any other takes on this matter as well.

jConsole connection to Progress Sonic MQ 8.5

אין תגובות:

פרסום תגובה