Show TOC Start of Content Area

Function documentation Template Monitors  Locate the document in its SAP Library structure

Use

There are cases when some of the parameters specified in the installation part of the monitor-configuration.xml (<monitor-tree> element) are not known beforehand and have to be supplied dynamically. For instance, it may not be clear what the display name of the monitor must be, what attribute have to be monitored on the resource side, and so on.

Example

A bank wants to have a more detailed information about all the clients who have performed transactions exceeding 10,000 EUR. For each of these clients, the bank wants to keep the name, the address, and the telephone number. When instrumenting the bank with monitoring you know that there will be some objects (whose count is not known beforehand), and that each of these objects will have monitors of the same type (for example, text monitor for name, configuration monitor for address, and long monitor for phone number). What you do not know is the name under which each of these objects will be instantiated in the monitoring tree, and what parameter you have to supply to the methods in the resource MBean that returns each of the monitored values. In such cases, a resource MBean will usually have the following methods: public String getClientName(int clientID), public ConfigurationList getClientAddress(int clientID), and public long getClientPhone(int clientID).

In such cases, the monitoring framework provides a means of installing sub-trees (can be one monitor only) of nodes in the monitoring tree, based on a common template. The sub-trees that are installed have a common structure and differ only in some parameters (for instance, the name). The responsibility of the monitored resource is to provide a method in the resource MBean or to emit JMX notifications that give the missing dynamic data to be filled in in the templates. In the example above, the resource MBean can have a method public int[] listVIPClientIDs() that returns the list of unique identifiers of all clients who have performed transactions over 10,000 EUR.

Upon receiving dynamic data for a certain template, the monitoring framework first checks if there are some instances missing from the previous installation and, if so, removes them from the monitoring tree. For example, a client with ID 666 may have performed a transaction over 10,000 EUR in the past, but after that he/she has stopped working with this bank. Therefore, the second time the dynamic data is retrieved, this ID is missing in the list of IDs and the sub-tree that was installed for it in the previous retrieval is removed from the tree.

After removing the sub-trees for the missing entities, the monitoring framework iterates over the array of dynamically supplied data and, for each of the entities in this array, installs a sub-tree following the template filled with the information from the entity.

For more information about the template monitors, see Using Template Monitors.

 

 

End of Content Area