Registering the application for event notifications

A set of RMC subroutines enables an application to register with the RMC subsystem for event notifications.

An event is a change in an attribute that is of interest to the application.

To register for event notifications, the application calls a particular RMC subroutine and provides it with an event expression. In most cases, an event expression consists of one or more attribute names (usually dynamic attribute names), one or more mathematical comparison symbols, and one or more constants that together describe the event of interest. The RMC subsystem will evaluate the event expression when the attribute values are observed. The RMC subsystem observes, or obtains, the values of attributes specified in event expressions either at periodic intervals or whenever a new value is supplied by the associated resource manager, depending on the variable type of the attribute.

When the RMC subsystem evaluates an event expression, it will trigger an event if the expression evaluates to True. For example, resources of the IBM.FileSystem resource class use the dynamic attribute PercentTotUsed to represent the percentage of space used in a file system. The following event expression, once registered with the RMC subsystem for a resource, would cause the RMC subsystem to notify the application if the particular file system resource is over 90 percent full.
PercentTotUsed > 90

As already stated, each event expression refers to a particular attribute value. This is usually a dynamic attribute, since such attributes represent changing characteristics of a resource. Once the application registers with the RMC subsystem for event notifications based on a particular event expression, the RMC subsystem will observe the value of the attribute and evaluate the event expression. If the event expression evaluates to True, the RMC subsystem will notify the application.

When observing attribute values to evaluate event expressions, RMC remembers the previously observed value of the attribute. If the event expression suffixes the attribute name with @P, this represents the previously observed value of the attribute. For example, resources of the IBM.Host resource class have the dynamic attribute ProcRunQueue, which indicates the average number of processes that are waiting for the processor. The following event expression, once registered with the RMC subsystem for an IBM.Host resource, would cause the RMC subsystem to notify the application if the average number of processes in the run queue has increased by 50 percent or more between observations.
(ProcRunQueue - ProcRunQueue@P) >= (ProcRunQueue@P * 0.5)
Although most event expressions consist of attribute names, one or more mathematical comparison symbols, and one or more constants, this is not True if the attribute type is of variable type Quantum. An attribute of variable type Quantum signifies a change, but has no value associated with it. To register for events involving a single attribute of type Quantum, the event expression must consist of the attribute name only.
For example, the IBM.FileSystem resource class has the dynamic attribute ResourceDefined that is of type Quantum. Although it has no value, it is asserted whenever a resource of the class is created. The following event expression, once registered with the RMC subsystem for the IBM.FileSystem resource class, would cause the RMC subsystem to notify the application when a file system is created.
ResourceDefined
To register for events involving more than one attribute name, where at least one attribute name is an attribute of type Quantum, the attributes of type Quantum can only be used as operands of boolean operators. For example, the IBM.FileSystem resource class has the dynamic resource attributes ConfigChanged and PercentTotused. The attribute ConfigChanged is of type Quantum, while PercentTotused is not. The following event expression would result in an event notification if the file system is more than 90% full or the persistent attributes of the resource are modified:

PercentTotUsed > 90 || ConfigChanged 

When registering for event notifications, a cluster applicaiton can optionally specify a rearm event expression. Like most event expressions, a rearm event expression consists of one or more attribute names, one or more mathematical comparison symbol, and one or more constants. The attributes in the rearm event expression do not need to be the same as the attributes that are used in the event expression. If a rearm event expression is specified, then the RMC will stop evaluating the event expression once it tests True, and instead will evaluate the rearm event expression until it tests True. Once the rearm event expression tests True, the RMC subsystem will once again evaluate the event expression.

The following diagram illustrates the cycle of event expression / rearm event expression evaluation.
top event This figure illustrates the cycle of event expression / rearm event expression evaluation.
To understand why the application might want to specify a rearm event expression when registering for event notifications, consider the event registration that specifies the following event expression on an IBM.FileSystem resource.
PercentTotUsed > 90
For this event expression, the RMC subsystem will periodically observe the value of the PercentTotUsed attribute for the resource and will evaluate the event expression. If the event expression evaluates to True, the RMC subsystem will notify the application. If there is no rearm event expression, and the event expression still tests True the next time the RMC subsystem evaluates it, the RMC subsystem will again notify the application. The RMC subsystem will continue to notify the application each time it evaluates the event expression until it tests false. In some cases, the application may want these repeated notifications. In other situations, however, it might be preferable to be notified once until the problem has been solved and only then "rearm" the event expression. The rearm event expression is a way of telling the RMC subsystem when the event expression should be evaluated again. In our example, say the application also provides the following rearm event expression when registering for the event notifications.
PercentTotUsed < 75

If this rearm event expression is specified, then once the event expression PercentTotUsed > 90 evaluates to True, the RMC subsystem will stop evaluating it, and will instead evaluate the rearm event expression until it tests True. When calling the RMC subroutine to register for event notifications, the application can specify whether or not it also wants to be notified when the rearm event expression evaluates to True. Whether the application chooses to be notified or not, once the rearm event expression tests True, the RMC subsystem will toggle to once again evaluate the event expression.