Hi,
Triggers are used in two cases:
- for groups (after online, after offline, after faulted)
- for resources (after status change)
All Triggers located in /opt/VRTSvcs/bin/triggers and named by the reason of calling, e.g. postonline, postoffline, resstatechange.
So, to use a trigger when the status of a resource changes:
- configure the service group to use the resstatechange trigger
hagrp -modify
TriggerResStateChange 1
- create a script in /opt/VRTSvcs/bin/triggers called resstatechange. This will be called on all systems, when the status of the resource is change (called with parameters
If you want to perform an action on the system where the resource becomes online, you have to do somethine like
THISHOST=`hostname`
STATE=`hares -state $2 -sys $THISHOST`
if
then
.. .. perform action
fi
Hope that helps
Ralph