|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Cluster Reference Manual Oracle Solaris Cluster 4.0|
- set resource status
scha_resource_setstatus -R resource -G group -s status [-m msg]
The scha_resource_setstatus command sets the Status and Status_msg properties of a resource that is managed by the Resource Group Manager (RGM). This command is intended to be used by the resource's monitor to indicate the resource's state as perceived by the monitor. It provides the same functionality as the scha_resource_setstatus(3HA) C function.
When you execute the scha_resource_setstatus(1HA) command, the Status and Status_msg properties of the resource are updated with the values that you specify. Oracle Solaris Cluster logs the change to the resource status in the cluster system log, which you can view with cluster administration tools.
You need solaris.cluster.resource.admin RBAC authorization to use this command. See rbac(5).
You must also be able to assume a role to which the Oracle Solaris Cluster Commands rights profile has been assigned to use this command. Authorized users can issue privileged Oracle Solaris 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 Oracle Solaris Cluster commands that are assigned to the Oracle Solaris 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 Oracle Solaris Cluster commands.
The following options are supported:
Specifies the resource group that contains the resource.
Specifies the text string that you want to assign to the Status_msg property of the resource. If you do not specify this option, the value of the resource's Status_msg is set to NULL.
Specifies the resource whose status is to be set.
Specifies the value of status: OK, DEGRADED, FAULTED, UNKNOWN, or OFFLINE.
Example 1 Setting the Status of Resource R1 With a Status_msg
The following command sets the status of resource R1 in resource group RG2 to OK and sets the Status_msg to Resource R1 is OK:
scha_resource_setstatus -R R1 -G RG2 -s OK -m "Resource R1 is OK"
Example 2 Setting the Status of Resource R1 Without a Status_msg
The following command sets the status of R1 in resource group RG2 to DEGRADED and sets the Status_msg to NULL:
scha_resource_setstatus -R R1 -G RG2 -s DEGRADED
The following exit status codes are returned:
The command completed successfully.
An error occurred.
Failure error codes are described in scha_calls(3HA).
See attributes(5) for descriptions of the following attributes: