Extending the WebSphere Business Monitor sample

You can use the command line interface to change some of the monitoring properties of the deployed message flow:

  1. To find out which event sources are enabled, run the mqsireportflowmonitoring command:
    mqsireportflowmonitoring MB8BROKER -e WBMonitorEventsExecGroup 
    -f TotalPurchaseOrderFlow -n

    The mqsichangeflowmontoring command changes the enable and disable state of a configured event source that is defined in a message flow. Issue the following command to disable the event sources in the two MQOutput nodes:

    mqsichangeflowmonitoring MB8BROKER -e
    WBMonitorEventsExecGroup -f TotalPurchaseOrderFlow 
    -s GoldOrderTotal.terminal.in -i disable
    mqsichangeflowmonitoring MB8BROKER -e
    WBMonitorEventsExecGroup -f TotalPurchaseOrderFlow 
    -s RegularOrderTotal.terminal.in -i disable

    This action disables the event source in the GoldOrderTotal and RegularOrderTotal MQOutput nodes.

  2. Use the mqsireportflowmonitoring command to output the monitoring properties for the message flow as an XML monitoring profile:
    mqsireportflowmonitoring MB8BROKER -e WBMonitorEventsExecGroup 
    -f TotalPurchaseOrderFlow  -x -p <output file name>

    The output from this command is found in the TotalPurchaseOrderFlowProfile.xml file in the WBMonitorEventsProject.

    By editing this file, using an XML editor, you can change the event source configuration for a node. For example, to remove purchaseOrderID from the Transaction start event remove the following code:

    <profile:complexContent>
      <profile:payloadQuery profile:queryText="$Body/PO:purchaseOrder/PO:purchaseOrderID">
    	<profile:prefixMapping profile:prefix="PO" profile:URI="http://www.ibm.com/ProcessOrder" />
      </profile:payloadQuery>
    </profile:complexContent>
    
  3. Complete the following steps:
    1. Create a configurable service. For example, use the following command:
      mqsicreateconfigurableservice MB8BROKER -c MonitoringProfiles 
      -o ComplexContentMonitoringProfile
    2. Load the XML file that contains the profile. For example, use the following command:
      mqsichangeproperties MB8BROKER -c MonitoringProfiles 
      -o ComplexContentMonitoringProfile -p ComplexContentMonitoringProfile.xml 
      -n profileProperties
    3. Associate the profile with the message flow. For example, use the following command:
      mqsichangeflowmonitoring MB8BROKER -e WBMonitorEventsExecGroup 
      -f TotalPurchaseOrderFlow -m ComplexContentMonitoringProfile -c active

A skeletal example of a monitoring profile is also included in the MonitoringProfile.xml file in WBMonitorEventsProject.

Using the Export Monitoring Information option

The sample contains a monitor model, WMBMonitorEventsModel, which is created by using the Export option in the WebSphere Message Broker Toolkit to export monitoring information about the message flow. This section describes the steps to create the monitor model.

  1. In the workbench:
    1. Right-click the sample Message Broker project, WBMonitorEventsProject, select Export.
    2. Select Business Monitoring > Application monitoring information, click Next.
    3. Select WBMonitorEventsProject from the list of projects, click Browse to set a location and file name in the To .zip file: field. Click Finish.

    The exported .zip file is created in the location specified. A log folder is created in the Message Broker project. This folder contains a log of the generation of the monitoring information from the message flow.

  2. In the Monitor Model Editor (MME):
    1. Click Import > Business Monitoring > Application monitoring information .zip file to import the .zip file that you created earlier.
    2. Select the name of the exported file, click Next.
    3. Enter the project name, WBMonitorEventsV7_Project, in the Target Monitor Project field, click New Project. Enter the project name WBMonitorEventsV7_Model in the Target Monitor Model field.
    4. In the "Choose what to Monitor" pane, select TotalPurchaseOrderFlow and in the Monitoring Templates pane, select Average Transaction Duration and Number of Failed Transactions.
    5. Switch to the Emitted Events pane. Because you selected Monitoring Templates, the following emitted events are already selected in the Emitted Events pane:
      • InputOrder.transaction.Start
      • InputOrder.transaction.End
      • InputOrder.transaction.Rollback
    6. Select GoldOrderTotal. In the Emitted Events pane, select GoldOrderTotal.terminal.in
    7. Select RegularOrderTotal. In the Emitted Events pane, select Select RegularOrderTotal.terminal.in
    8. Click Next > Finish.

    A monitor model called WBMonitorEventsModel is created. Events Parts are created for each XPath query that is used to add application data to the event in the message flow definition. You can now create metrics and key performance indicators (KPIs) to monitor this application data.

For more information about creating metrics and KPIs in a monitor model in WebSphere Business Monitor, see This link opens in a new window IBM WebSphere Business Process Management Information Center.

Back to sample home