MQ Analyticizer v0.2.1.7
========================================================================
README FIRST!
Copyright (c) 2010, Kristian Karpati
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the <MQ Analyticizer> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Description:
MQ Analyticizer is a program that will collect and gather statistics from IBM Websphere MQ. It is compatibile with v6.0 or higher. I have only tested the program on windows based machines, but it should work on any unix platforms as well. Currently the only stats being gathered and stored in the MySQL database are some of the statistics for queues, which include queue depth, enqueue rate, dequeue rate, highest depth, and the time since the statistics have been reset.
Prerequistes:
1. You will need an installation of IBM Websphere MQ Server Edition with at least one running queue manager. There is a free 90 day trial available of v7 at http://www.ibm.com/developerworks/downloads/ws/wmq/. The queue manager can be running locally or remotely, it doesn't matter.
2. You will need an installation of MySQL 5.1 which you can get at http://dev.mysql.com/downloads/mysql/. This will need to be installed locally at the same location you will install and run the MQ Analyticizer v0.2.1.7. (This will change in the future so you can have more freedom to install the MQ Analyticizer on the system of your choosing).
3. You will Java installed on the machine you will be running the MQ Analyticizer v0.2.1.7 which you can get at http://java.com/en/download/index.jsp, at the time of this writing the latest version is Version 6 update 18.
Installation:
1. Unzip 'MQ Analyticizer v0.2.1.7' to the directory of your choosing.
2. Open up the folder and edit the MySQL script 'mysqltablesv1_3.sql' in notepad.
3. Select all the content in the file (Ctrl+A) and then open the 'MYSQL Command Line Client'
4. Enter your password to your MySQL installation and then paste all of the content you entered, then press 'Enter'.
5. Type in 'show databases;' and press enter to verify the database was created, it will show up as 'mqanalyticizer'
6. Type in 'use mqanalyticizer;' and press enter.
7. Type in 'show tables;' and press enter to verify all tables were created.
8. The only one of interest currently is 'qdepth' so type in 'describe qdepth;' and press enter. you should see:
mysql> describe qdepth;
+----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| QMGRNAME | varchar(30) | NO | | NULL | |
| QNAME | varchar(100) | NO | | NULL | |
| DATE | date | NO | | NULL | |
| TIME | time | NO | | NULL | |
| QDEPTH | int(11) | NO | | NULL | |
| ENQ | int(11) | NO | | NULL | |
| DEQ | int(11) | NO | | NULL | |
| HIDEPTH | int(11) | NO | | NULL | |
| TSR | int(11) | NO | | NULL | |
+----------+--------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)
!You are done with the MySQL portion of the install!
9. In the same folder that had 'mysqltablesv1_3.sql'
10. Navigate to 'mqanalyticizer\config\' directory and edit 'qmgrs.xml'
11. Fill in the information like below, you can add or remove qmgrs simply by adding another <qmgr> tag, the example file holds two qmgrs as shown below:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : qmgrs.xml
Created on : October 24, 2009, 12:00 AM
Updated : January 28, 2010, 08:32 AM
Author : Kristian
Description:
Purpose of the document follows.
-->
<qmgrs>
<qmgr>
<name>D300D1</name>
<port>1414</port>
<fqhdn>kristian-server</fqhdn>
<host>kristian-server</host>
<ipaddr>192.168.0.60</ipaddr>
<svrconn>SYSTEM.ADMIN.SVRCONN</svrconn>
</qmgr>
<qmgr>
<name>D300D2</name>
<port>1415</port>
<fqhdn>kristian-server</fqhdn>
<host>kristian-server</host>
<ipaddr>192.168.0.60</ipaddr>
<svrconn>SYSTEM.ADMIN.SVRCONN</svrconn>
</qmgr>
</qmgrs>
! You are finished with the installation !
Running the program:
1. Open command prompt and navigate to the root directory of MQ Analyticizer.
2. Run the program by typing 'java -jar MQAnalyticizer.jar' and pressing enter.
(If you run into errors go back and verify your steps, it is very easy to not setup everything correctly)
3. The program will continue to collect information every minute until you kill it by pressing Ctrl-C.
! You are finished running the program !
Viewing your results:
1. Go back into the 'MySQL Command Line Client' and remember to 'use mqanalyticzer;'
2. Type in 'select * from qdepth;' and press enter. You should see results similar to:
mysql> select * from qdepth;
+-----+----------+-------------------------------------------+------------+----------+--------+------+-----+---------+-----+
| id | QMGRNAME | QNAME | DATE | TIME | QDEPTH | ENQ | DEQ | HIDEPTH | TSR |
+-----+----------+-------------------------------------------+------------+----------+--------+------+-----+---------+-----+
| 1 | D300D1 | ACCT.TEST.QUEUE | 2010-01-28 | 09:29:52 | 0 | 0 | 0 | 0 | 0 |
| 2 | D300D1 | SYSTEM.ADMIN.ACCOUNTING.QUEUE | 2010-01-28 | 09:29:52 | 354 | 354 | 0 | 354 | 0 |
| 3 | D300D1 | SYSTEM.ADMIN.ACTIVITY.QUEUE | 2010-01-28 | 09:29:52 | 0 | 0 | 0 | 0 | 0 |
| 4 | D300D1 | SYSTEM.ADMIN.CHANNEL.EVENT | 2010-01-28 | 09:29:52 | 0 | 0 | 0 | 0 | 0 |
| 5 | D300D1 | SYSTEM.ADMIN.COMMAND.EVENT | 2010-01-28 | 09:29:52 | 0 | 0 | 0 | 0 | 0 |
| 6 | D300D1 | SYSTEM.ADMIN.COMMAND.QUEUE | 2010-01-28 | 09:29:52 | 0 | 26 | 26 | 0 | 0 |
| 7 | D300D1 | SYSTEM.ADMIN.CONFIG.EVENT | 2010-01-28 | 09:29:52 | 0 | 0 | 0 | 0 | 0 |
| 8 | D300D1 | SYSTEM.ADMIN.LOGGER.EVENT | 2010-01-28 | 09:29:52 | 0 | 0 | 0 | 0 | 0 |
| 9 | D300D1 | SYSTEM.ADMIN.PERFM.EVENT | 2010-01-28 | 09:29:52 | 0 | 0 | 0 | 0 | 0 |
| 10 | D300D1 | SYSTEM.ADMIN.QMGR.EVENT | 2010-01-28 | 09:29:52 | 1 | 1 | 0 | 1 | 0 |
| 11 | D300D1 | SYSTEM.ADMIN.STATISTICS.QUEUE | 2010-01-28 | 09:29:52 | 1462 | 1462 | 0 | 1462 | 0 |
! FINISH !
Thank you for taking your time and using my program, any suggestion, errors, etc. are welcome!
- Kristian
kristiankarpati@hotmail.com