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_cluster_get(1HA)


NAME

 scha_cluster_get - access cluster information

SYNOPSIS

 scha_cluster_get -O optag ...

DESCRIPTION

 

The scha_cluster_get command accesss information about a cluster. 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 Resource Group Manager (RGM) facility. It provides the same information as the scha_cluster_get(3HA) function.

Information is output by the command to standard output in formatted strings as described in scha_cmds(1HA). Output is takes the form of a string or strings on separate lines. The output can be stored in shell variables and parsed using shell facilities or awk(1) for use in scripts.


OPTIONS

 

The following options are supported:

-O optag
The optag argument indicates the information to be accessed. Depending on the optag, an additional argument may be needed to indicate the cluster node for which information is to be retrieved. Case is not considered in recognition of the optag argument.

The following optag values are supported:
NODENAME_LOCAL
Outputs the name of the cluster node where command is executed.
NODENAME_NODEID
Outputs the name of the cluster node indicated by the numeric identifier. Requires an additional unflagged argument that is a numeric cluster node identifier.
ALL_NODENAMES
Outputs on successive lines the names of all nodes in the cluster.
ALL_NODEIDS
Outputs on successive lines the numeric node identifiers of all nodes in the cluster.
NODEID_LOCAL
Outputs the numeric node identifier for the node where the command is executed.
NODEID_NODENAME
Outputs the numeric node identifier of the node indicated by the name. Requires an additional unflagged argument that is the name of a cluster node.
PRIVATELINK_HOSTNAME_LOCAL
Outputs the hostname by which the node that the command is run on is addressed on the cluster interconnect.
PRIVATELINK_HOSTNAME_NODE
Outputs the hostname by which the named node is addressed on the cluster interconnect. Requires an additional unflagged argument that is the name of a cluster node.
ALL_PRIVATELINK_HOSTNAMES
Outputs on successive lines the hostnames by which all cluster nodes are addressed on the cluster interconnect.
NODESTATE_LOCAL
Outputs UP or DOWN depending on the state of the node where the command is executed.
NODESTATE_NODE
Outputs UP or DOWN depending on the state of the named node. Requires an additional unflagged argument that is the name of a cluster node.
SYSLOG_FACILITY
Outputs the number of the syslog(3c) facility that the RGM uses for log messages. The value is 24, which corresponds to the daemon facility. You can use this value as the facility level in the logger(1) command to log messages in the cluster log.
ALL_RESOURCEGROUPS
Outputs on successive lines the names of all the resource groups that are being managed on the cluster.
ALL_RESOURCETYPES
Outputs on successive lines the names of all the resource types that are registered on the cluster.
CLUSTERNAME
Outputs the name of the cluster.

EXAMPLES

 Example 1. Using the scha_cluster Command in a Shell Script
 

The following shell script uses the scha_cluster_get(1HA) command to print whether each cluster node is up or down:

 
#!/bin/sh
nodenames=`scha_cluster_get -O All_Nodenames`
for node in $nodenames
do
     state=`scha_cluster_get -O NodeState_Node $node`
     printf "State of node: %s\n exit: %d\n value: %s\n" "$node" $? "$state"
done

EXIT STATUS

 

The following exit values are returned:

0
Successful completion.
non-0
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 StabilityStable

SEE ALSO

 

awk(1), logger(1), sh(1), scha_cmds(1HA), scha_calls(3HA), scha_cluster_get(3HA), attributes(5)



Sun Cluster 3.1Go To TopLast Changed 5 May 2003

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