Sun Microsystems, Inc.
   www.sun.com docs.sun.com | | |  
   
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
    
 
Sun Cluster Commandsscha_resource_get(1HA)


NAME

 scha_resource_get - access resource information

SYNOPSIS

 scha_resource_get -O optag -R resource [-G group ...]

DESCRIPTION

 

The scha_resource_get command accesses information about a resource that is under the control of the Resource Group Manager (RGM) cluster facility. The resource information that can be accessed includes properties of the resource's type.

scha_resource_get 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_resource_get(3HA) C function.

Information is output by the command to stdout in formatted strings as described in scha_cmds(1HA). Output is a string or several strings output 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.

You need solaris.cluster.resource.read RBAC authorization to use this command. See rbac(5).

You must also be able to assume a role to which the Sun Cluster Commands rights profile has been assigned to use this command. Authorized users can issue privileged Sun Cluster commands on the command line from the pfsh(1), pfcsh(1), or pfksh(1) profile shell. A profile shell is a special kind of shell that enables you to access privileged Sun Cluster commands that are assigned to the Sun Cluster Commands rights profile. A profile shell is launched when you run su(1m) to assume a role. You can also use pfexec(1) to issue privileged Sun Cluster commands.


OPTIONS

 

The following options are supported:

-G group
Is the name of the resource group in which the resource has been configured. Although this argument is optional, the command will run more efficiently if it is included.
-O optag
Indicates the information to be accessed. Depending on the optag, an additional operand might be needed to indicate the cluster node for which information is to be retrieved. The case of optag arguments does not matter.

The following optags retrieve the corresponding resource properties. The value of the named property of the resource is output. The RESOURCE_STATE, STATUS, NUM_RG_RESTARTS, and NUM_RESOURCE_RESTARTS properties refer to the value on the node where the command is executed (see r_properties(5)).
 
R_DESCRIPTION
TYPE
ON_OFF_SWITCH
MONITORED_SWITCH
RESOURCE_STATE
CHEAP_PROBE_INTERVAL
THOROUGH_PROBE_INTERVAL
RETRY_COUNT
RETRY_INTERVAL
FAILOVER_MODE
RESOURCE_DEPENDENCIES
RESOURCE_DEPENDENCIES_WEAK
NETWORK_RESOURCES_USED
SCALABLE
PORT_LIST
LOAD_BALANCING_POLICY
LOAD_BALANCING_WEIGHTS
AFFINITY_TIMEOUT
WEAK_AFFINITY
UDP_AFFINITY
STATUS
START_TIMEOUT
STOP_TIMEOUT
VALIDATE_TIMEOUT
UPDATE_TIMEOUT
INIT_TIMEOUT
FINI_TIMEOUT
BOOT_TIMEOUT
MONITOR_START_TIMEOUT
MONITOR_STOP_TIMEOUT
MONITOR_CHECK_TIMEOUT
PRENET_START_TIMEOUT
POSTNET_STOP_TIMEOUT
NUM_RG_RESTARTS
NUM_RESOURCE_RESTARTS
TYPE_VERSION
RESOURCE_PROJECT_NAME
STATUS_NODE
Requires an unflagged argument that names a node. Outputs the value of the resource's STATUS property for the named node.
RESOURCE_STATE_NODE
Requires an unflagged argument that names a node. Outputs the value of the resource's RESOURCE_STATE property for the named node.
EXTENSION
Requires an unflagged argument that names an extension of the resource. Outputs the type of property followed by its value, on successive lines. Shell scripts might need to discard the type to obtain the value, as shown in EXAMPLES.
ALL_EXTENSIONS
Outputs on successive lines the names of all extension properties of the resource.
GROUP
Outputs the name of the resource group into which the resource is configured.


The following optags retrieve the corresponding resource type properties. The value of the named property of the resource's type is output. For descriptions of resource type properties, see rt_properties(5).
 
RT_DESCRIPTION
RT_BASEDIR
RT_SYSTEM
SINGLE_INSTANCE
INIT_NODES
INSTALLED_NODES
FAILOVER
API_VERSION
RT_VERSION
PKGLIST
START
STOP
VALIDATE
UPDATE
INIT
FINI
BOOT
MONITOR_START
MONITOR_STOP
MONITOR_CHECK
PRENET_START
POSTNET_STOP
IS_LOGICAL_HOSTNAME
IS_SHARED_ADDRESS
RESOURCE_PROJECT_NAME
-R resource
Is the name of a resource that is being managed by the RGM cluster facility.

EXAMPLES

 Example 1. A Sample Script Using scha_resource_get
 

The following script is passed -R and -G arguments, which provide the required resource name and resource group name, as well as the resource type. Next, the scha_resource_get command accesses the Retry_count property of the resource and the enum-type LogLevel extension property of the resource.

 
#!/bin/sh

while getopts R:G: opt
do
     case $opt in
           R)      resource="$OPTARG";;
           G)      group="$OPTARG";;
     esac
done

retry_count=`scha_resource_get -O Retry_count -R $resource \\ 
-G $group`
printf "retry count for resource %s is %d\n" $resource \\
$retry_count

LogLevel_info=`scha_resource_get -O Extension -R $resource \\
-G $group LogLevel`

# Get the enum value that follows the type information
# of the extension property.  Note that the preceding
# assignment has already changed the newlines separating
# the type and the value to spaces for parsing by awk.

loglevel=`echo $LogLevel_info | awk '{print $2}'`
retry_count=`scha_resource_get -O Retry_count -R $resource \\
-G $group`
printf "retry count for resource %s is %d\n" $resource \\
$retry_count

EXIT STATUS

 

The following exit values are returned:

0
The command completed successfully.
nonzero
An error occurred.

Failure error codes are described in scha_calls(3HA).

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWscdev
Interface StabilityEvolving

SEE ALSO

 

awk(1), scha_cmds(1HA), scha_calls(3HA), scha_resource_get(3HA), attributes(5), r_properties(5), rt_properties(5)



Sun Cluster 3.1Go To TopLast Changed 6 May 2003

 
      
      
Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.