| |
NAME
| | scha_cluster_get - access cluster information |
SYNOPSIS
| | scha_cluster_get -O optag ... |
| |
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.
|
| |
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.
|
| | 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
|
|
|
| |
The following exit values are returned:
-
0
- Successful completion.
-
non-0
- An error
occurred.
Failure error codes are described in scha_calls(3HA).
|
| |
See attributes(5)
for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| Availability | SUNWscdev |
| Interface Stability | Stable |
|
| Sun Cluster 3.1 | Go To Top | Last Changed 5 May 2003 |
| |