Technical Blog Post
Abstract
MQ Agent: Monitoring Queue Depth Events
Body
Objective
Following questions will be answered in this blog entry:
How to use MQ monitoring agent to get alert on Queue Depth High and Queue Full MQ events?
Can we get an alert when the Queue Depth Low event occurs?
Products
This discussion applies to WebSphere MQ agent included in both products:
ITCAM for Messaging
IBM Cloud Application Performance Management (APM V8)
MQ - Queue depth events settings
IBM MQ (aka WebSphere MQ) generates queue depth events for a queue when following conditions are met:
Performance Events are enabled at the "queue manager" and queue depth events are enabled at the "queue" level.
The settings to enable queue depth events for MQ and the event behavior is described in detail in the following Knowledge Center topic:
MQ Agent - Queue Depth event monitoring
The MQ monitoring agent provides "Current Events" attribute group to monitor following events, queue depth events are highlighted below:
v Channel_Stopped,
v Queue_Depth_High,
v Queue_Full,
v Queue_Service_Interval_High,
v Bridge_Stopped,
v Channel_Not_Activated
Corresponding to the two queue depth events, two product provided situations (APM thresholds) are provided by the agent.
ITCAM MQ agent provides following situations:
MQSeries_Queue_Depth_High and MQSeries_Queue_Full
APM V8 MQ agent provides following thresholds:
MQ_Queue_Depth_High
*IF *VALUE Current_Events.Event *EQ Queue_Depth_High
MQ_Queue_Full
*IF *VALUE Current_Events.Event *EQ Queue_Full
The Queue_Depth_Low event is not directly monitored by the MQ agent, however, when the Queue_Depth_Low occurs, the MQ_Queue_Depth_High situation alert gets reset as per MQ queue depth event behavior.
To enable the monitoring, distribute these situations (thresholds) to agent MSNs or resource groups (APM).
Example
This section provides an example of the MQ commands to enable queue depth events at MQ.
We will use the following requirement as an example:
"MQ admin says that we want to receive alerts when the depth of the queue is 10% full, when queue becomes 50% full and when the queue is 100% full."
Queue Manager name: TESTQM; Queue name: TESTQ1
As the mqm user, or as a user with sufficient permissions, start runmqsc session on command line.
/opt/mqm/bin/runmqsc TESTQM
5724-H72 (C) Copyright IBM Corp. 1994, 2018.
Starting MQSC for queue manager TESTQM.
1) In "runmqsc" session, enable performance events for the queue manager (TESTQM):
DIS QMGR PERFMEV
AMQ8408I: Display Queue Manager details.
QMNAME(TESTQM) PERFMEV(DISABLED)
ALTER QMGR PERFMEV(ENABLED) <- enable if it is disabled
AMQ8005I: IBM MQ queue manager changed.
2) Set queue depth related settings for the queue (TESTQ1)
Check current settings:
DIS QL(TESTQ1) QDEPTHHI,QDPHIEV,QDEPTHLO,QDPLOEV, QDPMAXEV
AMQ8409I: Display Queue details.
QUEUE(TESTQ1) TYPE(QLOCAL)
MAXDEPTH(5000) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(DISABLED)
As per requirement mentioned above, set queue depth low mark of 10% (QDEPTHLO), queue depth high mark of 50% (QDEPTHHI). Enable events queue depth low (QDPLOEV), queue depth high (QDPHIEV), queue full (QDPMAXEV). Following command does that:
ALTER QL(TESTQ1) QDPHIEV(ENABLED),QDPLOEV(ENABLED), QDPMAXEV(ENABLED), QDEPTHHI(50), QDEPTHLO(10)
AMQ8008I: IBM MQ queue changed.
References
UID
ibm11083177