ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Performance Monitoring » MQ event type : PERFM.EVENT

Post new topic  Reply to topic
 MQ event type : PERFM.EVENT « View previous topic :: View next topic » 
Author Message
basabi2520
PostPosted: Thu Dec 13, 2012 12:20 am    Post subject: MQ event type : PERFM.EVENT Reply with quote

Apprentice

Joined: 05 Jun 2012
Posts: 28
Location: singapore

Hi all,
This is continuation from my previous post:

http://www.mqseries.net/phpBB2/viewtopic.php?t=61574

Related to the posts :
http://www.mqseries.net/phpBB2/viewtopic.php?t=34499

Actually made a QdepthHi event happen in my TESTQ and event message passed to PERFM.EVENT.
Need to read the reason for the event from PERFM.EVENT queue.
As am triggering a alert mail from PERFM.EVENT queue.

Googling ......! Any help pls

Thanks,
Baskar
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Dec 13, 2012 4:15 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The reason for a qdepthhi event is that some queue has had more messages put on it than the threshold for generating the event.

So the depth of the queue is now high.

There are two reasons for a queue depth to increase. The first is that an application is putting messages faster than they can be gotten. The second is that an application is getting messages slower than they are put.

Nothing in the event will tell you which of these two things is occurring.

All of the data that exists in a given queue depth high message is documented here: http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/topic/com.ibm.mq.doc/mo12040_.htm

If you are unable to make a complete diagnosis of the problem from that data, then you have started to understand that monitoring must take into account more than one piece of information to determine a course of action.
Back to top
View user's profile Send private message
basabi2520
PostPosted: Wed Dec 19, 2012 1:25 am    Post subject: Reply with quote

Apprentice

Joined: 05 Jun 2012
Posts: 28
Location: singapore

Hi all,

Finally achieved with my task .
Heartful thanks to all who helped me.
Like to share my study on
Quote:
MQ Monitoring Event using java


1. Enabled PERFM.EVENT in the QMGR.
2. Set and enabled Qdepthhi to 80 and Qdepthlow to 20 in the <MQUEUE>
2. Defined Trigger in SYSTEM.ADMIN.PERFM.EVENT.
3. Defined PROCESS which will a run shell script.
4. Shell script runs a java appln which will read event message and send mail with Qdepth and type of event.

->When Event occur, QMGR will through a event msg to PERFM.EVENT queue
->As soon as PERFM.EVENT receives a msg , trigger invokes the PROCESS, as PROCESS in turn runs a java appln thru shell script , reads the event msg from PERFM.EVENT Q and finally sends a mail.

Java Code :

Code:
MQMessage myMessage = new MQMessage();
         while (true) {
            myMessage.clearMessage();
            myMessage.correlationId = MQC.MQCI_NONE;
            myMessage.messageId = MQC.MQMI_NONE;
            browseQueue.get(myMessage, gmo);
            j = j + 1;

            MQCFH hdr = new MQCFH(myMessage);
            int reason_code = hdr.reason;
            strbuf.append("Name of the queue : <b>");
            PCFParameter p;

            if (hdr.reason == CMQC.MQRC_Q_DEPTH_HIGH) {
               for (int i = 0; i < hdr.parameterCount; i++) {
                  p = PCFParameter.nextParameter(myMessage);
                  if (p.getParameter() == CMQC.MQCA_BASE_OBJECT_NAME) {
                     qname = p.getStringValue();
                     // System.out.println("qname------>>>:" + qname);
                  }
               }
               eventType = "Queue Depth High Event Occurred ";
            }

            if (hdr.reason == CMQC.MQRC_Q_DEPTH_LOW) {
               for (int i = 0; i < hdr.parameterCount; i++) {
                  p = PCFParameter.nextParameter(myMessage);
                  if (p.getParameter() == CMQC.MQCA_BASE_OBJECT_NAME) {
                     qname = (String) p.getValue();
                     // System.out.println("qname------>>>:" + qname);
                  }
               }
               eventType = "Queue Depth Low Event Occurred";
            }

            if (hdr.reason == CMQC.MQRC_Q_FULL) {
               for (int i = 0; i < hdr.parameterCount; i++) {
                  p = PCFParameter.nextParameter(myMessage);
                  if (p.getParameter() == CMQC.MQCA_BASE_OBJECT_NAME) {
                     qname = (String) p.getValue();
                     // System.out.println("qname------>>>:" + qname);
                  }
               }
               eventType = "Queue Full Event Occurred";
            }
            strbuf.append(qname);
            strbuf.append("</b><br>");
            strbuf.append("Number of messages in <b>");
            strbuf.append(qname);
            strbuf.append("<b>:");
            QDepthMonitor qdm = new QDepthMonitor();
            strbuf.append(qdm.getDepth(qname));// Get Base Queue depth
            strbuf.append("</b><br>");
            strbuf.append(dumpHexMessage1(myMessage));
            System.out.println("reason_code-------->>:" + reason_code);
            if (reason_code == 2033) {
               // System.out.println(" No more messages");
               eventType = "EMPTY QUEUE";
               // strbuf.append("\n\n<br><br> Empty Queue");
            }
            if (reason_code == 2224) {
               System.out.println(" Queue Depth High Event");
               eventType = "Queue Depth High Event";
            } else if (reason_code == 2225) {
               System.out.println(" Queue Depth Low Event");
               eventType = "Queue Depth Low Event";
            } else if (reason_code == 2053) {
               System.out.println(" Queue Full");
               eventType = "Queue Full";
            }

         }


to find Qdepth:

try {
         int openOptions = MQC.MQOO_INQUIRE;
         qMgr = new MQQueueManager(myQmgr);

         MQQueue destQueue = qMgr.accessQueue(myQueue, openOptions);
         depth = destQueue.getCurrentDepth();
         System.out.println("Current Depth:" + depth);
         destQueue.close();
         qMgr.disconnect();
      } catch (Exception err) {
         err.printStackTrace();
      }
      return depth;


There might be a better way to achieve , still


thanks for all your support
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Performance Monitoring » MQ event type : PERFM.EVENT
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.