Show TOC Start of Content Area

Procedure documentation Installing the Template Locate the document in its SAP Library structure

Procedure

...

       1.      BankMBean:

public String[] getExceededClientsNames();

 

       2.      Bank:

public String[] getExceededClientsNames() {

   return transaction.getExceededClientsNames();

}

 

This method provides the names of all clients that have exceeded 10,000 EUR.

This is the dynamically supplied information that enables the template to install new monitors of a certain type on the fly. All dynamically installed monitors are grouped under a summary named List of txs over 10,000 EUR.

       3.      Modify the monitor-configuration.xml:

                            a.      Define the monitor-semantics:

Note

No entry in the monitor-semantics part is required to install a template.

 

                            b.      Define the monitor-tree:

<summary name="List of txs over 10,000 EUR" configuration-group="ExceededClientsNames">

      <object name="%0" configuration-group="Exceeded">

 

          <template-info template-name="ExceededClients">

          <polled-by-template period="1" unit="MINUTE">

            <generating-resource name="BankMBean" type="APPLICATION"/>

            <template-attribute-mapping>

              <observed-resource-attribute name="ExceededClientsNames"/>

            </template-attribute-mapping>

          </polled-by-template>

        </template-info>

 

        <integer-monitor name="Amount" configuration-group="ExceededClientsMoney">

          <monitored-resource name="BankMBean" type="APPLICATION"/>

          <integer-attribute-mapping>

            <integer-attribute>

              <invoked-resource-method name="getExceededClientsMoney">

             <parameter position="0" type="String" value="%0"/>

            </invoked-resource-method>

            </integer-attribute>

          </integer-attribute-mapping>

        </integer-monitor>  

 

        <long-monitor name="Transaction duration" configuration-group="tsDuration">

          <monitored-resource name="BankMBean" type="APPLICATION"/>

          <long-attribute-mapping>

            <long-attribute>

              <invoked-resource-method name="getTransactionDuration">

             <parameter position="0" type="String" value="%0"/>

            </invoked-resource-method>

            </long-attribute>

          </long-attribute-mapping>

        </long-monitor>

 

      </object>

 

The element that installs the template is <template-info>. In the case of this example, this element specifies that on each new entry in the dynamically supplied data, the monitoring framework must install a new subtree of monitors which, as a root, has an object with the name of the respective client, and configuration group Exceeded.

Example

The resource MBean returns an array containing three elements – cl1, cl2, and cl3. The template will checks whether the three objects named cl1, cl2, and cl3 are built and under each of them there are two monitors – one integer monitor describing the amount of money for the respective client, and one long monitor, describing the duration of the transaction.

Result

The List of txs over 10,000 EUR monitor appears in the monitoring tree under Applications ® Bank Information.

 

 

End of Content Area