The following table describes the resstatechange event trigger:
This trigger is invoked under the following conditions:
Resource goes from OFFLINE to ONLINE.
Resource goes from ONLINE to OFFLINE.
Resource goes from ONLINE to FAULTED.
Resource goes from FAULTED to OFFLINE. (When fault is cleared on non-persistent resource.)
Resource goes from FAULTED to ONLINE. (When faulted persistent resource goes online or faulted non-persistent resource is brought online outside VCS control.)
Resource is restarted by an agent because resource faulted and RestartLimit was greater than 0.
This event trigger is configurable.
-resstatechange triggertype system resource previous_state new_state
triggertype - represents whether trigger is custom (triggertype=0) or internal (triggertype=1).
For this trigger, triggertype=0.
system - represents the name of the system.
resource - represents the name of the resource.
previous_state - represents the resource's previous state.
new_state - represents the resource's new state.
To enable the trigger
This event trigger is not enabled by default. You must enable resstatechange by setting the attribute TriggerResStateChange to 1 in the main.cf file, or by issuing the command:
hagrp -modify service_group TriggerResStateChange 1
Use the resstatechange trigger carefully. For example, enabling this trigger for a service group with 100 resources means that 100 hatrigger processes and 100 resstatechange processes are fired each time the group is brought online or taken offline. Also, this is not a "wait-mode trigger. Specifically, VCS invokes the trigger and does not wait for trigger to return to continue operation.
However, the attribute is configurable at the resource level. To enable resstatechange for a particular resource, you can set the attribute TriggerResStateChange to 1 in the main.cf file or issue the command:
hares -modify resource TriggerResStateChange 1