Show TOC Start of Content Area

Procedure documentation Creating the Bank Rank State Monitor  Locate the document in its SAP Library structure

Procedure

...

       1.      BankMBean

public String getBankState();

 

       2.      Bank

public String getBankState() {

   return BankProperties.getBankState();

}

 

       3.      Modify the monitor-configuration.xml:

                            a.      Define the monitor-semantics:

<state-configuration-group name="Rank" alert-mode="ALWAYS">

   <description ID="Ranking">Ranking of the bank</description>

   <data-collection>

      <polled-by-monitor period="1" unit="MINUTE"/>

   </data-collection>

   <color-states>

      <green-states>

         <state>Big</state>

      </green-states>

      <yellow-states>

         <state>Medium</state>

         <state>Small</state>

      </yellow-states>

      <red-states>

         <state>Bankrupted</state>

      </red-states>

   </color-states>

</state-configuration-group>

 

                            b.      Define the monitor-tree:

<state-monitor name="Bank ranking" configuration-group="Rank">

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

        <state-attribute-mapping>

   <state-attribute>

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

    </state-attribute>

         </state-attribute-mapping>

</state-monitor>

 

The monitoring framework expects a String value for state monitors, that is why the return value of the getBankState () method is String. This method is declared in the BankMBean interface and it is implemented in the class Bank. In the monitor-semantics part of the monitor-configuration.xml a state-configuration-group is declared with name Rank, which is used for creating the node in the monitor tree(the monitor-tree part in the XML). The ID in the Bank ranking description is the name of the monitor shown in the tree. Also, in monitor-semantics (under color-states) the colors of the value are declared: green-state for Big, yellow-state for Medium, and Small and red-state for Bankrupted.

Result

The Bank Rank monitor appears in the monitoring tree under Applications Bank Information General Information.

 

 

End of Content Area