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 HA and Data Servicesscha_resource_setstatus(3HA)


NAME

 scha_resource_setstatus - function to set resource status

SYNOPSIS

 
cc [flags...]-I /usr/cluster/include file -L /usr/cluster/lib -l scha
#include <scha.h>
scha_err_t scha_resource_setstatus(const char *rname, const char *rgname, scha_rsstatus_t status, const char *status_msg);

DESCRIPTION

 

The scha_resource_setstatus() function sets the Status and Status_msg property of a resource that is managed by the Resource Group Manager (RGM) cluster facility. It is intended to be used by the resource's monitor to indicate the resource's state as perceived by the monitor.

The rname argument names the resource whose status is to be set.

The rgname argument is the name of the group containing the resource.

The status is an enum value of type scha_rsstatus_t: SCHA_RSSTATUS_OK, SCHA_RSSTATUS_OFFLINE, SCHA_RSSTATUS_FAULTED, SCHA_RSSTATUS_DEGRADED or SCHA_RSSTATUS_UNKNOWN.

The status_msg argument is the new value for the Status_msg property and may be NULL.

A successful call to scha_resource_setstatus() causes the Status and Status_msg properties of the resource to be updated to the supplied values. The update of the resource status is logged in the cluster system log and is visible to cluster administration tools.


RETURN VALUES

 

The scha_resosurce_setstatus() function returns the following:

0
The function succeeded.
non-zero
The function failed.

ERRORS

 
SCHA_ERR_NOERR
Function succeeded.

See scha_calls(3HA) for a description of other error codes.


EXAMPLES

 Example 1. Using the scha_resource_setstatus() Function
 
 
#include <scha.h>

scha_err_t err_code;
const char *rname = "example_R";
const char *rgname = "example_RG";

err_code = scha_resource_setstatus(rname, rgname,
           SCHA_RSSTATUS_OK, "No problems");

FILES

 
/usr/cluster/include/scha.h
include file
/usr/cluster/lib/libscha.so
library

ATTRIBUTES

 

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

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWscdev
Interface StabilityEvolving

SEE ALSO

 

scha_resource_setstatus(1HA), scha_calls(3HA), scha_strerror(3HA), attributes(5)



Sun Cluster 3.1Go To TopLast Changed 19 Apr 2002

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