NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | EXIT STATUS | ATTRIBUTES | SEE ALSO
The scha_resourcegroup_get command accesses information about a resource group that is under the control of the Resource Group Manager (RGM) cluster facility.
The command is intended to be used in shell script implementations of the callback methods for resource types that represent services controlled by the cluster's RGM.
It provides the same information as the scha_resourcegroup_get(3HA) C function.
Information is output by the command to standard output in formatted strings as described in scha_cmds(1HA). Output is in the format of a string or several strings on separate lines. The output can be stored in shell variables and parsed using shell facilities or awk(1) for further use by the script.
The following options are supported:
The name of the resource group.
The optag argument indicates the information to be accessed. Depending on the the optag, an additional operand may be needed to indicate the cluster node for which information is to be retrieved. Case is not considered in recognition of the optag arguments.
The following optags retrieve the corresponding resource group properties. The value of the named property of the resource group is output. The RG_STATE property refers to the value on the node where the command is executed.
RG_DESCRIPTION NODELIST MAXIMUM_PRIMARIES DESIRED_PRIMARIES FAILBACK RESOURCE_LIST RG_STATE RG_DEPENDENCIES GLOBAL_RESOURCES_USED RG_MODE IMPLICIT_NETWORK_DEPENDENCIES PINGPONG_INTERVAL PATHPREFIX RG_PROJECT_NAME RG_STATE_NODE |
RG_STATE_NODE requires an unflagged argument that names a node. Outputs the value of the resource group's RG_STATE property for the named node
The following script is passed a -G argument giving the needed resource group name. Next, the scha_resourcegroup_get command is used to get the list of resources in the resource group.
#!/bin/sh while getopts G: opt do case $opt in G) group="$OPTARG";; esac done resource_list=`scha_resourcegroup_get -O Resource_list -G $group` for resource in $resource_list do printf "Group: %s contains resource: %s\n" "$group" "$resource" done |
The following exit values are returned:
Successful completion.
An error occurred.
Failure error codes are described scha_calls(3HA).
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE |
ATTRIBUTE VALUE |
---|---|
Availability |
SUNWscdev |
Interface Stability |
Stable |
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | EXIT STATUS | ATTRIBUTES | SEE ALSO