Sun Cluster Geographic Edition System Administration Guide

Configuring a Protection Group to Execute a Script at Switchover or Takeover

After you have created a script, you must configure the protection group to execute the script if a switchover or takeover occurs. If a switchover or takeover occurs, the script is executed on the cluster that is becoming primary.

ProcedureHow to Configure a Protection Group to Execute a Script at Switchover or Takeover

Steps
  1. Log in to one of the cluster nodes.

    You must be assigned the Geo Management RBAC rights profile to complete this procedure. For more information about RBAC, see Sun Cluster Geographic Edition Software and RBAC.

  2. Configure the RoleChange_ActionCmd and RoleChange_ActionArgs properties of the protection group.


    # geopg set-prop -p RoleChange_ActionCmd=fully-qualified-script -p RoleChange_ActionArgs=script-arguments
    
    -p property-setting

    Sets the properties of the protection group

    Specify the path to the command by using the RoleChange_ActionCmd property. This path should be valid on all nodes of all partner clusters that can host the protection group.

    Define the arguments that you want to append to the command line when the action command is run by using the RoleChange_ActionArgs property.

    For more information about the properties you can set, see Appendix A, Standard Sun Cluster Geographic Edition Properties.

    protection-group-name

    Specifies the name of the protection group


Example 14–2 Configuring a Protection Group to Execute a Command at Cluster Switchover or Takeover

The following command configures a protection group to execute a custom command called newDNS:


# geopg set-prop -p RoleChange_ActionCmd=/usr/bin/newDNS \
-p RoleChange_ActionArgs=domain=companyx.com,ip=1.2.3.4 avspg