MFT monitor list message format
The XML messages that are published as retained publications to the topic string SYSTEM.FTE/monitors/agent_name/monitor_name conform to the MonitorList.xsd schema. Each XML message lists an active monitor belonging to that agent. This information is used by the fteListMonitors command and the IBM MQ Explorer plug-in to display a list of monitors to the user. The MonitorList.xsd schema document is located in the MQ_INSTALLATION_PATH/mqft/samples/schema directory. The MonitorList.xsd schema imports Monitor.xsd, which is in the same directory.
Schema
The following schema describes which elements are valid in a monitor list XML message.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com/xmlns/wmqfte/7.0.1/MonitorDefinition" xmlns="http://www.ibm.com/xmlns/wmqfte/7.0.1/MonitorDefinition"> <xsd:include schemaLocation="Monitor.xsd"/> <xsd:element name="monitorList"> <xsd:complexType> <xsd:sequence> <xsd:element name="status" type="monitorStatusType" minOccurs="1" maxOccurs="1"/> <xsd:element name="configuration" type="monitorConfigurationType" minOccurs="1" maxOccurs="1"/> <xsd:element name="pollInterval" type="pollIntervalType" minOccurs="1" maxOccurs="1"/> <xsd:element name="batch" type="batchType" minOccurs="1" maxOccurs="1"/> <xsd:any minOccurs="0"/> </xsd:sequence> <xsd:attribute name="version" type="versionType" use="required"/> <xsd:attribute name="agent" type="xsd:string" use="required"/> <xsd:attribute name="monitor" type="xsd:string" use="required"/> </xsd:complexType> </xsd:element> <xsd:complexType name="monitorStatusType"> <xsd:sequence> <xsd:any minOccurs="0"/> </xsd:sequence> <xsd:attribute name="state" type="xsd:token"/> <xsd:anyAttribute/> </xsd:complexType> <xsd:complexType name="monitorConfigurationType"> <xsd:sequence> <xsd:element name="description" type="xsd:string" minOccurs="1" maxOccurs="1" /> <xsd:element name="resources" type="monitorResourcesType" minOccurs="0" maxOccurs="1" /> <xsd:element name="triggerMatch" type="triggerMatchType" minOccurs="0" maxOccurs="1" /> <xsd:element name="tasks" type="monitorListTasksType" minOccurs="0" maxOccurs="1" /> </xsd:sequence> <xsd:anyAttribute/> </xsd:complexType> <xsd:complexType name="monitorListTasksType"> <xsd:sequence> <xsd:element name="task" type="monitorListTaskType" minOccurs="1" maxOccurs="1" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="monitorListTaskType"> <xsd:sequence> <xsd:element name="name" type="monitorTaskNameType" minOccurs="0" maxOccurs="1" /> <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1" /> <xsd:element name="taskXML" type="xsd:string" minOccurs="0" maxOccurs="1" /> </xsd:sequence> </xsd:complexType> </xsd:schema>
Understand the monitor list message
The elements and attributes used in the monitor list messages are described in the following list:
- <monitorList>
- Group element containing the elements describe a monitor that
is defined for the agent.
Attribute Description agent Required. The name of the agent that the resource monitor is defined on. monitor Required. The name of the monitor. Unique for this agent. version Required. The version of the monitor list message format. - <status>
- The status of the monitor.
Attribute Description state The state of the monitor. - <configuration>
- Group element containing the elements describe the configuration
of the monitor.
- <description>
- A description of the monitor. (Not currently used.)
- <resources>
- The resource or resources being monitored.
- <directory>
- A directory to monitor.
Attribute Description recursionLevel The number of directory levels down from the top level to monitor. id The ID of the resource. - <queue>
- A queue to monitor.
Attribute Description id The ID of the resource.
- <triggerMatch>
- Element that contains the <conditions> element.
- <conditions>
- Element that contains the condition or conditions that the resource
monitor is monitoring for. This element can contain only one of the
following elements: <allOf>, <anyOf>, or <condition>.
- <allOf>
- Element that contains the condition or conditions that the resource monitor is monitoring for. This element can contain one or many <condition> elements. For the resource monitor to be triggered all of the conditions inside of this element must be met.
- <anyOf>
- Element that contains the condition or conditions that the resource monitor is monitoring for. This element can contain one or many <condition> elements. For the resource monitor to be triggered only one of the conditions inside of this element must be met.
- <condition>
- Element that contains a single condition that the resource monitor is monitoring for. This element can contain only one of the following elements: <fileMatch>, <fileNoMatch>, <fileSize>, <queueNotEmpty>, <completeGroups>, or <fileSizeSame>. It can also contain a <name> element and a <resource> element.
- <tasks>
- Group element to contain elements which specify the tasks to invoke when the monitor trigger conditions are satisfied.
- <task>
- Group element which defines an individual task that the monitor will invoke when the trigger conditions are satisfied. Currently only one task can be specified.
- <name>
- Name of the task. Accepts any alphanumeric characters.
- <description>
- Description of the task. Any text value is allowed.
- <taskXML>
- The XML message that describes the task that the monitor is to perform. The contents of this element are in an escaped XML format.
- <pollInterval>
- The time interval between each check of the resource against
the trigger condition.
Attribute Description units Specifies the time units for the poll interval. Valid values are: - seconds
- minutes
- hours
- days
- weeks
- months
- years
- <batch>
- The maximum number of trigger matches to include in a single batch.
Attribute Description maxSize The maximum number of trigger matches to include in a single batch
The following XML shows an example of a retained publication which is published to the topic string SYSTEM.FTE/monitors/agent_name/MONITORTWO when the monitor called MONITORTWO is created on AGENT_JUPITER. The escaped XML within the <taskXML> element describes the task that is submitted when the monitor condition is met.
<?xml version="1.0" encoding="UTF-8"?> <lst:monitorList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lst="http://www.ibm.com/xmlns/wmqfte/7.0.1/MonitorDefinition" xsi:schemaLocation="http://www.ibm.com/xmlns/wmqfte/7.0.1/MonitorDefinition MonitorList.xsd" version="4.00" agent="AGENT_JUPITER" monitor="MONITORTWO"> <status state="started"/> <configuration> <description/> <resources> <directory recursionLevel="0" id="">/srv/nfs/incoming</directory> </resources> <triggerMatch> <conditions> <condition> <name/> <resource id=""/> <fileMatch> <pattern>*.completed</pattern> </fileMatch> </condition> </conditions> </triggerMatch> <tasks> <task> <name/> <description/> <taskXML><?xml version="1.0" encoding="UTF-8"?><request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.00" xsi:noNamespaceSchemaLocation="FileTransfer.xsd"><managedTransfer> <originator><hostName>example.com.</hostName> <userID>mqm</userID></originator> <sourceAgent QMgr="QM_JUPITER" agent="AGENT_JUPITER"/> <destinationAgent QMgr="QM_JUPITER" agent="AGENT_SATURN"/> <transferSet><item checksumMethod="MD5" mode="binary"> <source disposition="leave" recursive="false"><file >/srv/nfs/incoming/*.txt</file></source> <destination exist="error" type="directory"> <file>/srv/backup</file></destination> </item></transferSet></managedTransfer> </request> </taskXML> </task> </tasks> </configuration> <pollInterval units="minutes">1</pollInterval> <batch maxSize="1"/> </lst:monitorList>Parent topic: XML message formats used by MFT