Example: Configuring a resource monitor to monitor a queue

You can specify an IBM® MQ queue as the resource to be monitored by a resource monitor by using the -mq parameter with the fteCreateMonitor command.

About this task

In this example, the resource to be monitored is the queue MONITORED_QUEUE. This queue must be on the monitoring agent's queue manager, QM_NEPTUNE. The condition that the queue is monitored for is the presence of a complete group of messages. The task to be performed if the condition is satisfied is defined in the file task.xml.

Note: Do not create more than one resource monitor to monitor an individual queue. If you do then unpredictable behavior occurs.

Procedure

Type the following command:
fteCreateMonitor -ma AGENT_NEPTUNE -mn myMonitor -mm QM_NEPTUNE -mq MONITORED_QUEUE
  -mt task.xml -tr completeGroups -pi 5 -pu minutes

The monitor checks the queue every five minutes to see if the condition completeGroups is true. If there are one or more complete groups on the queue, the monitor runs the task defined in the task.xml file once for each complete group.