[ Previous | Next | Table of Contents | Index | Legal | ]

Performance Toolbox Version 2 and 3 Guide and Reference


Appendix F. RSi Subroutines

This appendix discusses the following topics:


RSi Subroutines

RSiAddSetHot Subroutine

Purpose

Add a single set of peer statistics to an already defined SpmiHotSet (SpmiHotSet Structure).

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiHotVals *RSiAddSetHot(rhandle, HotSet, StatName,
GrandParent,
                                 maxresp, threshold, frequency, feed_type,
                                 except_type, severity, trap_no)
RSiHandle rhandle;
struct SpmiHotSet *HotSet;
char *StatName;
cx_handle GrandParent;
int maxresp;
int threshold;
int frequency;
int feed_type;
int excp_type;
int severity;
int trap_no;

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

HotSet
Specifies a pointer to a valid structure of type SpmiHotSet as created by the RSiCreateHotSet (RSiCreateHotSet Subroutine) subroutine call.

StatName
Specifies the name of the statistic within the subcontexts (peer contexts) of the context identified by the GrandParent parameter.

GrandParent
Specifies a valid cx_handle handle as obtained by another subroutine call. The handle must identify a context with at least one subcontext, which contains the statistic identified by the StatName parameter. If the context specified is one of the RTime contexts, no subcontext need to be created at the time the SpmiAddSetHot subroutine call is issued; the presence of the metric identified by the StatName parameter is checked against the context class description.

If the context specified has or may have multiple levels of instantiable context below it (such as the FS and RTime/ARM contexts), the metric is only searched for at the lowest context level. The SpmiHotSet created is a pseudo hotvals structure used to link together a peer group of SpmiHotVals structures, which are created under the covers, one for each subcontext of the GrandParent context. In the case of RTime/ARM, if additional contexts are later added under the GrandParent contexts, additional hotsets are added to the peer group. This is transparent to the application program, except that the RSiGetHotItem (RSiGetHotItem Subroutine) subroutine call will return the peer group SpmiHotVals pointer rather than the pointer to the pseudo structure.

Note that specifying a specific volume group context (such as FS/rootvg) or a specific application context (such as RTime/ARN/armpeek) is still valid and won't involve creation of pseudo SpmiHotVals structures.

maxresp
Must be non-zero if excp_type specifies that exceptions or SNMP traps must be generated. If specified as zero, indicates that all SpmiHotItems that meet the criteria specified by threshold must be returned, up-to a maximum of maxresp items. If both exceptions/traps and feeds are requested, the maxresp value is used to cap the number of exceptions/alerts as well as the number of items returned. If feed_type is specified as SiHotAlways, the maxresp parameter is still used to return at most maxresp items.

Where the GrandParent argument specifies a context that has multiple levels of instantiable contexts below it, the maxresp is applied to each of the lowest level contexts above the the actual peer contexts at a time. For example, if the GrandParent context is FS (file systems) and the system has three volume groups, then a maxresp value of 2 could cause up to a maximum of 2 x 3 = 6 responses to be generated.

threshold
Must be non-zero if excp_type specifies that exceptions or SNMP traps must be generated. If specified as zero, indicates that all values read qualify to be returned in feeds. The value specified is compared to the data value read for each peer statistic. If the data value exceeds the threshold, it qualifies to be returned as an SpmiHotItems element in the SpmiHotVals structure. If the threshold is specified as a negative value, the value qualifies if it is lower than the numeric value of threshold. If feed_type is specified as SiHotAlways, the threshold value is ignored for feeds. For peer statistics of type SiCounter, the threshold must be specified as a rate per second; for SiQuantity statistics the threshold is specified as a level.

frequency
Must be non-zero if excp_type specifies that exceptions or SNMP traps must be generated. Ignored for feeds. Specifies the minimum number of minutes that must expire between any two exceptions/traps generated from this SpmiHotVals (SpmiHotVals Structure) structure. This value must be specified as no less than 5 minutes.

feed_type
Specifies if feeds of SpmiHotItems should be returned for this SpmiHotVals structure. The following values are valid:

excp_type
Controls the generation of exception data packets and/or the generation of SNMP Traps from xmservd. Note that these types of packets and traps can only actually be sent if xmservd is running. Because of this, exception packets and SNMP traps are only generated as long as xmservd is active. Traps can only be generated on AIX. The conditions for generating exceptions and traps are controlled by the threshold and frequency parameters. The following values are valid for excp_type:

severity
Required to be positive and greater than zero if exceptions are generated, otherwise specify as zero. Used to assign a severity code to the exception for display by exmon.

trap_no
Required to be positive and greater than zero if SNMP traps are generated, otherwise specify as zero. Used to assign the trap number in the generated SNMP trap.

Return Values

If successful, the subroutine returns a pointer to a structure of type struct SpmiHotVals (SpmiHotVals Structure). If an error occurs, NULL is returned and an error text may be placed in the external character array RSiEMsg. If you attempt to add more values to a statset than the current local buffer size allows, RSiErrno is set to RSiTooMany. If you attempt to add more values than the buffer size of the remote host's xmservd daemon allows, RSiErrno is set to RSiBadStat and the status field in the returned packet is set to too_many_values.

The external integer RSiMaxValues holds the maximum number of values acceptable with the data-consumer's buffer size.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes) .

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiChangeFeed Subroutine

Purpose

Changes the frequency at which the xmservd on the host identified by the first argument daemon is sending data_feed packets for a statset.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiChangeFeed(rhandle, statset, msecs)
RSiHandle rhandle;struct SpmiStatSet *statset;int msecs;

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

statset
Must be a pointer to a structure of type struct SpmiStatSet (SpmiStatSet Structure), which was previously returned by a successful RSiCreateStatSet (RSiCreateStatSet Subroutine) subroutine call. Data feeding must have been started for this SpmiStatSet via a previous RSiStartFeed (RSiStartFeed Subroutine) subroutine call.

msecs
The number of milliseconds between the sending of data_feed packets. This number is rounded to a multiple of min_remote_int milliseconds by the xmservd daemon on the remote host. This minimum interval can be modified through the -i command line interval to xmservd.

Return Values

If successful, the subroutine returns zero, otherwise -1. A NULL error text is placed in the external character array RSiEMsg regardless of the subroutine's success or failure.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiChangeHotFeed Subroutine

Purpose

Changes the frequency at which the xmservd on the host identified by the first argument daemon is sending hot_feed packets for a statset or checking if exceptions or SNMP traps should be generated.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiChangeFeed(rhandle, hotset, msecs)
RSiHandle rhandle;struct SpmiHotSet *hotset;int msecs;

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

hotset
Must be a pointer to a structure of type struct SpmiHotSet (SpmiHotSet Structure), which was previously returned by a successful RsiCreateHotSet (RSiCreateHotSet Subroutine) subroutine call. Data feeding must have been started for this SpmiHotSet via a previous RSiStartHotFeed (RSiStartHotFeed Subroutine) subroutine call.

msecs
The number of milliseconds between the sending of Hot_feed packets. This number is rounded to a multiple of min_remote_int milliseconds by the xmservd daemon on the remote host. This minimum interval can be modified through the -i command line interval to xmservd.

Return Values

If successful, the subroutine returns zero, otherwise -1. A NULL error text is placed in the external character array RSiEMsg regardless of the subroutine's success or failure.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

In the sample program, the SpmiStatSet is created in the local function lststats shown previously in lines 6 through 10.

RSiClose Subroutine

Purpose

Terminates the RSI interface for a remote host connection.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

void RSiClose(rhandle)
RSiHandle rhandle;

Description

The RSiClose subroutine is responsible for:

  1. Removing the data-consumer program as a known data consumer on a particular host. This is done by sending a going_down packet to the host.
  2. Marking the RSI handle as not active.
  3. Releasing all memory allocated in connection with the RSI handle.
  4. Terminating the RSI interface for a remote host.

A successful RSiOpen (RSiOpen Subroutine) subroutine creates tables on the remote host it was issued against. Therefore, a data consumer program that has issued successful RSiOpen subroutine calls should issue an RSiClose (RSiClose Subroutine) subroutine call for each RSiOpen call before the program exits so that the tables in the remote xmservd daemon can be released.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen subroutine.

The macro RSiIsOpen can be used to test whether an RSI handle is open. It takes an RSiHandle as argument and returns true (1) if the handle is open, otherwise false (0).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files

/usr/include/sys/Rsi.h
Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiCreateHotSet Subroutine

Purpose

Creates an empty hotset on the remote host identified by the argument.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiHotSet *RSiCreateHotSet(rhandle)
RSiHandle rhandle;

Description

The RSiCreateHotSet subroutine allocates an SpmiHotSet (SpmiHotSet Structure) structure. The structure is initialized as an empty SpmiHotSet and a pointer to the SpmiHotSet structure is returned.

The SpmiHotSet structure provides the anchor point to a set of peer statistics and must exist before the RSiAddSetHot (RSiAddSetHot Subroutine) subroutine can be successfully called.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

Return Values

The RSiCreateHotSet subroutine returns a pointer to a structure of type SpmiHotSet if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiCreateStatSet Subroutine

Purpose

Creates an empty statset on the remote host identified by the argument.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiStatSet *RSiCreateStatSet(rhandle)
RSiHandle rhandle;

Description

The RSiCreateStatSet subroutine allocates an SpmiStatSet (SpmiStatSet Structure) structure. The structure is initialized as an empty SpmiStatSet and a pointer to the SpmiStatSet structure is returned.

The SpmiStatSet structure provides the anchor point to a set of statistics and must exist before the RSiPathAddSetStat (RSiPathAddSetStat Subroutine) subroutine can be successfully called.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

Return Values

The RSiCreateStatSet subroutine returns a pointer to a structure of type SpmiStatSet if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiDelSetHot Subroutine

Purpose

Deletes a single set of peer statistics identified by an SpmiHotVals (SpmiHotVals Structure) structure from an SpmiHotSet (SpmiHotSet Structure).

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiDelSetHot(rhandle, hsp, hvp)
RSiHandle rhandle;struct SpmiHotSet *hsp;struct SpmiHotVals*hvp;

Description

The RSiDelSetHot subroutine performs the following actions:

  1. Validates that the SpmiHotSet identified by the second argument exists and contains the SpmiHotVals statistic identified by the third argument.
  2. Deletes the SpmiHotVals value from the SpmiHotSet so that future data_feed packets do not include the deleted statistic.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

hsp
Must be a pointer to a structure type struct SpmiHotSet (SpmiHotSet Structure), which was previously returned by a successful RSiCreateHotSet (RSiCreateHotSet Subroutine) subroutine call.

hvp
Must be a handle of type struct SpmiHotVals (SpmiHotVals Structure) as returned by a successful RSiAddSetHot (RSiAddSetHot Subroutine) subroutine call. You cannot specify an SpmiHotVals that was internally generated by the Spmi library code as described under the GrandParent parameter to RSiAddSetHot (RSiAddSetHot Subroutine).

Return Values

If successful, the subroutine returns a zero value; otherwise it returns a non-zero value and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiDelSetStat Subroutine

Purpose

Deletes a single statistic identified by an SpmiStatVals (SpmiStatVals Structure) pointer from an SpmiStatSet (SpmiStatSet Structure).

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiDelSetStat(rhandle, ssp, svp)
RSiHandle rhandle;struct SpmiStatSet *ssp;struct SpmiStatVals*svp;

Description

The RSiDelSetStat subroutine performs the following actions:

  1. Validates the SpmiStatSet identified by the second argument exists and contains the SpmiStatVals statistic identified by the third argument.
  2. Deletes the SpmiStatVals value from the SpmiStatSet so that future data_feed packets do not include the deleted statistic.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

ssp
Must be a pointer to a structure type struct SpmiStatSet (SpmiStatSet Structure), which was previously returned by a successful RSiCreateStatSet (RSiCreateStatSet Subroutine) subroutine call.

svp
Must be a handle of type struct SpmiStatVals (SpmiStatVals Structure) as returned by a successful RSiPathAddSetStat (RSiPathAddSetStat Subroutine) subroutine call.

Return Values

If successful, the subroutine returns a zero value; otherwise it returns a non-zero value and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiFirstCx Subroutine

Purpose

Returns the first subcontext of an SpmiCx (SpmiCx Structure) context.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiCxLink *RSiFirstCx(rhandle, context, name,
descr)
RSiHandle rhandle;
cx_handle *context;
char **name;
char **descr;

Description

The RSiFirstCx subroutine performs the following actions:

  1. Validates that the context identified by the second argument exists.
  2. Returns a handle to the first element of the list of subcontexts defined for the context.
  3. Returns the short name and description of the subcontext.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

context
Must be a handle of type cx_handle, which was previously returned by a successful RSiPathGetCx (RSiPathGetCx Subroutine) subroutine call.

name
Must be a pointer to a pointer to a character array. The pointer must be initialized to point at a character array pointer. When the subroutine call is successful, the short name of the subcontext is returned in the character array pointer.

descr
Must be a pointer to a pointer to a character array. The pointer must be initialized to point at a character array pointer. When the subroutine call is successful, the description of the subcontext is returned in the character array pointer.

Return Values

If successful, the subroutine returns a pointer to a structure of type struct SpmiCxLink (SpmiCxLink Structure). If an error occurs or if the context doesn't contain subcontexts, NULL is returned and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiFirstStat Subroutine

Purpose

Returns the first statistic of an SpmiCx (SpmiCx Structure) context.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiStatLink *RSiFirstStat(rhandle, context, name,
descr)
RSiHandle rhandle;
cx_handle *context;
char **name;
char **descr;

Description

The RSiFirstStat subroutine performs the following actions:

  1. Validates that the context identified by the second argument exists.
  2. Returns a handle to the first element of the list of statistics defined for the context.
  3. Returns the short name and description of the statistic.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

context
Must be a handle of type cx_handle, which was previously returned by a successful RSiPathGetCx (RSiPathGetCx Subroutine) subroutine call.

name
Must be a pointer to a pointer to a character array. The pointer must be initialized to point at a character array pointer. When the subroutine call is successful, the short name of the statistics value is returned in the character array pointer.

descr
Must be a pointer to a pointer to a character array. The pointer must be initialized to point at a character array pointer. When the subroutine call is successful, the description of the statistics value is returned in the character array pointer.

Return Values

If successful, the subroutine returns a pointer to a structure of type struct SpmiStatLink (SpmiStatLink Structure). If an error occurs, NULL is returned and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiGetHotItem Subroutine

Purpose

Locates and decodes the next SpmiHotItems element at the current position in an incoming data packet of type hot_feed.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiHotVals *RSiGetHotItem(rhandle, HotSet, index, value,
absvalue, name)
RSiHandle rhandle;
struct SpmiHotSet **HotSet;
int *index;
float *value;
flost absvalue;
char **name;

Description

The RSiGetHotItem subroutine locates the SpmiHotItems structure in the hot_feed data packet indexed by the value of the index parameter. The subroutine returns a NULL value if no further SpmiHotItems structures are found. The RSiGetHotItem subroutine should only be executed after a successful call to the RSiGetHotSet subroutine.

The RSiGetHotItem subroutine is designed to be used for walking all SpmiHotItems elements returned in a hot_feed data packet. Because the data packet may contain elements belonging to more than one SpmiHotSet, the index is purely abstract and is only used to keep position. By feeding the updated integer pointed to by index back to the next call, the walking of the hot_feed packet can be done in a tight loop. Successful calls to RSiGetHotItem will decode each SpmiHotItems element and return the data value in value and the name of the peer context that owns the corresponding statistic in name.

Parameters


rhandle Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.
HotSet Used to return a pointer to a valid SpmiHotSet (SpmiHotSet Structure) structure as obtained by a previous RSiCreateHotSet (RSiCreateHotSet Subroutine) subroutine call. The calling program can use this value to locate the SpmiHotSet if its address was stored by the program after it was created. The time stamps in the SpmiHotSet are updated with the time stamps of the decoded SpmiHotItems element.
index A pointer to an integer that contains the desired relative element number in the SpmiHotItems array across all SpmiStatVals (SpmiStatVals Structure) contained in the data packet. A value of zero points to the first element. When the RSiGetHotItem subroutine returns, the integer contain the index of the next SpmiHotItems element in the data packet. By passing the returned index parameter to the next call to RSiGetHotItem, the calling program can iterate through all SpmiHotItems elements in the hot_feed data packet.
value A pointer to a float variable. A successful call will return the decoded data value of the peer statistic. Before the value is returned, the RSiGetHotItem function:
  • Determines the format of the data field as being either SiFloat or SiLong and extracts the data value for further processing.
  • Determines the data value as being either type SiQuantity or type SiCounter and performs one of the actions listed here:
    • If the data value is of type SiQuantity, the subroutine returns the val field of the SpmiHotItems structure.
    • If the data value is of type SiCounter, the subroutine returns the value of the val_change field of the SpmiHotItems structure divided by the elapsed number of seconds since the previous time a data value was requested for this set of statistics.
absvalue A pointer to a float variable. A successful call will return the decoded value of the val field of the SpmiHotItems structure of the peer statistic. In case of a statistic of type SiQuantity, this value will be the same as the one returned in the argument value. In case of a peer statistic of type SiCounter, the value returned is the absolute value of the counter.
name A pointer to a character pointer. A successful call will return a pointer to the name of the peer context for which the data value was read.

Return Values

The RSiGetHotItem subroutine returns a pointer to the current SpmiHotVals (SpmiHotVals Structure) structure within the hotset. If no more SpmiHotItems elements are available, the subroutine returns a NULL value. The structure returned contains the data, such as threshold, which may be relevant for presentation of the results of an SpmiGetHotSet subroutine call to end-users. In the returned SpmiHotVals structure, all fields contain the correct values as declared, except for the following:

stat Declared as SpmiStatHdl, actually points to a valid SpmiStat (SpmiStat Structure) structure. By casting the handle to a pointer to SpmiStat, data in the structure can be accessed.
grandpa Contains the cx_handle for the parent context of the peer contexts.
items When using the Spmi interface this is an array of SpmiHotItems structures. When using the RSiGetHotItem subroutine, the array is empty and attempts to access it will likely result in segmentation faults or access of not valid data.
path Will contain the path to the parent of the peer contexts. Even when the peer contexts are multiple levels below the parent context, the path points to the top context because the peer context identifiers in the SpmiHotItems elements will contain the path name from there and on. For example, if the hotvals peer set defines all volume groups, the path specified in the returned SpmiHotVals structure would be "FS" and the path name in one SpmiHotItems element may be "rootvg/lv01". When combined with the metric name from the stat field, the full path name can be constructed as, for example, "FS/rootvg/lv01/%totfree".

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiGetRawValue Subroutine

Purpose

Returns a pointer to a valid SpmiStatVals (SpmiStatVals Structure) structure for a given SpmiStatVals pointer by extraction from a data_feed packet. This subroutine call should only be issued from a callback function after it has been verified that a data_feed packet was received from the host identified by the first argument.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiStatVals RSiGetRawValue(rhandle, svp, index)
RSiHandle rhandle;
struct SpmiStatVals *svp;
int *index;

Description

The RSiGetRawValue subroutine performs the following:

  1. Finds an SpmiStatVals structure in the received data packet based upon the second argument to the subroutine call. This involves a lookup operation in tables maintained internally by the RSi interface.
  2. Updates the struct SpmiStat pointer in the SpmiStatVals structure to point at a valid SpmiStat structure.
  3. Returns a pointer to the SpmiStatVals structure. The returned pointer points to a static area and is only valid until the next execution of RSiGetRawValue.
  4. Updates an integer variable with the index into the ValsSet array of the data_feed packet, which corresponds to the second argument to the call.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

svp
A handle of type struct SpmiStatVals (SpmiStatVals Structure), which was previously returned by a successful RSiPathAddSetStat (RSiPathAddSetStat Subroutine) subroutine call.

index
A pointer to an integer variable. When the subroutine call succeeds, the index into the ValsSet array of the data feed packet is returned. The index corresponds to the element that matches the svp argument to the subroutine.

Return Values

If successful, the subroutine returns a pointer; otherwise NULL is returned and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiGetValue Subroutine

Purpose

Returns a data value for a given SpmiStatVals (SpmiStatVals Structure) pointer by extraction from the data_feed packet. This subroutine call should only be issued from a callback function after it has been verified that a data_feed packet was received from the host identified by the first argument.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

float RSiGetValue(rhandle, svp)
RSiHandle rhandle;
struct SpmiStatVals *svp;

Description

The RSiGetValue subroutine provides the following:

  1. Finds an SpmiStatVals structure in the received data packet based upon the second argument to the subroutine call. This involves a lookup operation in tables maintained internally by the RSi interface.
  2. Determines the format of the data field as being either SiFloat or SiLong and extracts the data value for further processing based upon its data format.
  3. Determines the value as either of type SiQuantity or SiCounter. If the former is the case, the data value returned is the val field in the SpmiStatVals structure. If the latter type is found, the value returned by the subroutine is the val_change field divided by the elapsed number of seconds since the previous data packet's time stamp.

Parameters

rhandle
Must be an RSiHandle, previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

svp
A handle of type struct SpmiStatVals (SpmiStatVals Structure), which was previously returned by a successful RSiPathAddSetStat (RSiPathAddSetStat Subroutine) subroutine call.

Return Values

If successful, the subroutine returns a non-negative value; otherwise it returns a negative value less than or equal to -1.0. A NULL error text is placed in the external character array RSiEMsg regardless of the subroutine's success or failure.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiInit Subroutine

Purpose

Allocates or changes the table of RSi handles.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

RSiHandle RSiInit(count)
int count;

Description

Before any other RSi call is executed, a data-consumer program must issue the RSiInit call. Its purpose is to either:

Parameters

count
Must specify the number of elements in the array of RSi handles. If the call is used to expand a previously allocated array, this argument must be larger than the current number of array elements. It must always be larger than zero. Specify the size of the array to be at least as large as the number of hosts your data-consumer program can talk to at any point in time.

Return Values

If successful, the subroutine returns the address of the allocated array. If an error occurs, an error text is placed in the external character array RSiEMsg and the subroutine returns NULL. When used to increase the size of a previously allocated array, the subroutine first allocates the new array, then moves the entire old array to the new area. Application programs should, therefore, refer to elements in the RSi handle array by index rather than by address if they anticipate the need for expanding the array. The array only needs to be expanded if the number of remote hosts a data-consumer program talks to might increase over the life of the program.

An application that calls RSiInit repeatedly needs to preserve the previous address of the RSiHandle array while the RSiInit call is re-executed. After the call has completed successfully, the calling program should free the previous array using the free subroutine.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see the RSiClose Subroutine.

RSiInstantiate Subroutine

Purpose

Creates (instantiates) all subcontexts of an SpmiCx (SpmiCx Structure) context object.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiInstantiate(rhandle, context)
RSiHandle rhandle;
cx_handle *context;

Description

The RSiInstantiate subroutine performs the following actions:

  1. Validates that the context identified by the second argument exists.
  2. Instantiates the context so that all subcontexts of that context are created in the context hierarchy. Note that this subroutine call currently only makes sense if the context's SiInstFreq is set to SiContInst or SiCfgInst because all other contexts would have been instantiated whenever the xmservd daemon was started.

The RSiInstantiate subroutine explicitly instantiates the subcontexts of an instantiable context. If the context is not instantiable, do not call the RSiInstantiate subroutine.

Parameters

rhandle
Must point to a structure of type RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

context
Must be a handle of type cx_handle, which was previously returned by a successful RSiPathGetCx (RSiPathGetCx Subroutine) subroutine call.

Return Values

If successful, the subroutine returns a zero value; otherwise it returns an error code as defined in SiError and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiInvite Subroutine

Purpose

Invites data suppliers on the network to identify themselves and returns a table of data-supplier host names.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

char **RSiInvite(resy_callb, excp_callb)
int (*resy_callb)();
int (*excp_callb)();

Description

The RSiInvite subroutine call broadcasts are_you_there messages on the network to provoke xmservd daemons on remote hosts to respond and returns a table of all responding hosts.

Parameters

The arguments to the subroutine are:

resy_callb
Must be either NULL or a pointer to a function that processes i_am_back packets as they are received from the xmservd daemons on remote hosts for the duration of the RSiInvite subroutine call. When the callback function is invoked, it is passed three arguments as described in the following information.

If this argument is specified as NULL, a callback function internal to the RSiInvite subroutine receives any i_am_back packets and uses them to build the table of host names the function returns.

excp_callb
Must be NULL or a pointer to a function that processes except_rec packets as they are received from the xmservd daemons on remote hosts. If a NULL pointer is passed, your application does not receive except_rec messages. When this callback function is invoked, it is passed three arguments as described in the following information.

This argument always overrides the corresponding argument of any previous RSiInvite or RSiOpen call, and it can be overridden by subsequent executions of either. In this way, your application can turn exception monitoring on and off. For an RSiOpen to override the exception processing specified by a previous open call, the connection must first be closed with the RSiClose call. That's because an RSiOpen against an already active handle is treated as a no-operation.

The resy_callb and excp_callb functions in your application are called with the following three arguments:

Return Values

If successful, the subroutine returns an array of character pointers, each of which contains a host name of a host that responded to the invitation. The returned host names are actually constructed as two "words" with the first one being the host name returned by the host in response to an are_you_there request; the second one being the character form of the host's IP address. The two "words" are separated by one or more blanks. This format is suitable as an argument to the RSiOpen (RSiOpen Subroutine) subroutine call. In addition, the external integer variable RSiInvTabActive contains the number of host names found. The returned pointer to an array of host names must not be freed by the subroutine call. The calling program should not assume that the pointer returned by this subroutine call remains valid after subsequent calls to RSiInvite. If the call is not successful, an error text is placed in the external character array RSiEMsg, an error number is placed in RSiErrno, and the subroutine returns NULL.

The list of host names returned by RSiInvite does not include the hosts your program has already established a connection with through an RSiOpen call. Your program is responsible for keeping track of such hosts. If you need a list of both sets of hosts, either let the RSiInvite call be the first one issued from your program or merge the list of host names returned by the call with the list of hosts to which you have connections.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, seeRSiOpen Subroutine.

RSiMainLoop Subroutine

Purpose

Allows an application to suspend execution and wait to get awakened when data feeds arrive.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

void RSiMainLoop(msecs)
int msecs;

Description

The RSiMainLoop subroutine:

  1. Allows the data-consumer program to suspend processing while waiting for data_feed packets to arrive from one or more xmservd daemons.
  2. Tells the subroutine that waits for data feeds to return control to the data-consumer program so that the latter can check for and react to other events.
  3. Invokes the subroutine to process data_feed packets for each such packet received.

To work properly, the RSiMainLoop subroutine requires that at least one RSiOpen (RSiOpen Subroutine) call has been successfully completed and that the connection has not been closed.

Parameters

msecs
The minimum elapsed time in milliseconds that the subroutine should continue to attempt receives before returning to the caller. Notice that your program releases control for as many milliseconds you specify but that the callback functions defined on the RSiOpen call may be called repetitively during that time.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see RSiOpen Subroutine.

RSiNextCx Subroutine

Purpose

Returns the next subcontext of an SpmiCx (SpmiCx Structure) context.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiCxLink *RSiNextCx(rhandle, context, link, name,
descr)
RSiHandle rhandle;
cx_handle *context;
struct SpmiCxLink *link;
char **name;
char **descr;

Description

The RSiNextCx subroutine:

  1. Validates that the context identified by the second argument exists.
  2. Returns a handle to the next element of the list of subcontexts defined for the context.
  3. Returns the short name and description of the subcontext.

Parameters

rhandle
Must point to a structure of type RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

context
Must be a handle of type cx_handle, which was previously returned by a successful RSiPathGetCx (RSiPathGetCx Subroutine) subroutine call.

link
Must be a pointer to a structure of type struct SpmiCxLink (SpmiCxLink Structure), which was previously returned by a successful RSiFirstCx (RSiFirstCx Subroutine) or RSiNextCx (RSiNextCx Subroutine) subroutine call.

name
Must be a pointer to a pointer to a character array. The pointer must be initialized to point at a character array pointer. When the subroutine call is successful, the short name of the subcontext is returned in the character array pointer.

descr
Must be a pointer to a pointer to a character array. The pointer must be initialized to point at a character array pointer. When the subroutine call is successful, the description of the subcontext is returned in the character array pointer.

Return Values

If successful, the subroutine returns a pointer to a structure of type struct SpmiCxLink (SpmiCxLink Structure). If an error occurs, or if no more subcontexts exist for the context, NULL is returned and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiNextStat Subroutine

Purpose

Returns the next statistic of an SpmiCx (SpmiCx Structure) context.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiStatLink *RSiNextStat(rhandle, context, link, name,
descr)
RSiHandle rhandle;
cx_handle *context;
struct SpmiStatLink *link;
char **name;
char **descr;

Description

The RSiNextStat subroutine:

  1. Validates that a context identified by the second argument exists.
  2. Returns a handle to the next element of the list of statistics defined for the context.
  3. Returns the short name and description of the statistic.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

context
Must be a handle of type cx_handle, which was previously returned by a successful RSiPathGetCx (RSiPathGetCx Subroutine) subroutine call.

link
Must be a pointer to a structure of type struct SpmiStatLink (SpmiStatLink Structure), which was previously returned by a successful RSiFirstStat (RSiFirstStat Subroutine) or RSiNextStat subroutine call.

name
Must be a pointer to a pointer to a character array. The pointer must be initialized to point at a character array pointer. When the subroutine call is successful, the short name of the statistics value is returned in the character array pointer.

descr
Must be a pointer to a pointer to a character array. The pointer must be initialized to point at a character array pointer. When the subroutine call is successful, the description of the statistics value is returned in the character array pointer.

Return Values

If successful, the subroutine returns a pointer to a structure of type struct SpmiStatLink. If an error occurs, or if no more statistics exists for the context, NULL is returned and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiOpen Subroutine

Purpose

Initializes the RSi interface for a remote host.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiOpen(rhandle, wait, bufsize, hostID, feed_callb,
            resy_callb, excp_callb)
RSiHandle rhandle;
int wait;
int bufsize;
char *hostID;
int (*feed_callb)();
int (*resy_callb)();
int (*excp_callb)();

Description

The RSiOpen subroutine performs the following actions:

  1. Establishes the issuing data-consumer program as a data consumer known to the xmservd daemon on a particular host. The subroutine does this by sending an are_you_there packet to the host.
  2. Initializes an RSi handle for subsequent use by the data-consumer program.

Parameters

The arguments to the subroutine are:

rhandle
Must point to an element of the RSiHandleStruct array, which is returned by a previous RSiInit (RSiInit Subroutine) call. If the subroutine is successful the structure is initialized and ready to use as a handle for subsequent RSi interface subroutine calls.

wait
Must specify the timeout in milliseconds that the RSi interface shall wait for a response when using the request-response functions. On LANs, a reasonable value for this argument is 100 milliseconds. If the response is not received after the specified wait time, the library subroutines retry the receive operation until five times the wait time has elapsed before returning a timeout indication. The wait time must be zero or more milliseconds.

bufsize
Specifies the maximum buffer size to be used for constructing network packets. This size must be at least 4,096 bytes. The buffer size determines the maximum packet length that can be received by your program and sets the limit for the number of data values that can be received in one data_feed packet. There's no point in setting the buffer size larger than that of the xmservd daemon because both must be able to handle the packets. If you need large sets of values, you can use the command line argument -b of xmservd to increase its buffer size up to 16,384 bytes.

The fixed part of a data_feed packet is 104 bytes and each value takes 32 bytes. A buffer size of 4,096 bytes allows up to 124 values per packet.

hostID
Must be a character array containing the identification of the remote host whose xmservd daemon is the one with which you want to talk. The first characters of the host identification (up to the first white space) is used as the host name. The full host identification is stored in the RSiHandle field longname and may contain any description that helps the end user identify the host used. The host name may be either in long format (including domain name) or in short format.

feed_callb
Must be a pointer to a function that processes data_feed packets as they are received from the xmservd daemon. When this callback function is invoked, it is passed three arguments as described in the following information.

resy_callb
Must be a pointer to a function that processes i_am_back packets as they are received from the xmservd daemon. When this callback function is invoked it is passed three arguments as described in the following information.

excp_callb
Must be NULL or a pointer to a function that processes except_rec packets as they are received from the xmservd daemon. If a NULL pointer is passed, your application does not receive except_rec messages. When this callback function is invoked, it is passed three arguments as described in the following information. This argument always overrides the corresponding argument of any previous RSiInvite (RSiInvite Subroutine) or RSiOpen (RSiOpen Subroutine) subroutine call and can itself be overridden by subsequent executions of either. In this way, your application can turn exception monitoring on and off. For an RSiOpen call to override the exception processing specified by a previous open call, the connection must first be closed with the RSiClose (RSiClose Subroutine) subroutine call.

The feed_callb, resy_callb, and excp_callb functions are called with the arguments:

RSiHandle. When a data_feed packet is received, the structure pointed to is guaranteed to represent the host sending the packet. In all other situations the RSiHandle structure may represent any of the hosts to which your application is talking.

Pointer of type pack * to the input buffer containing the received packet. In callback functions, always use this pointer rather than the pointer in the RSiHandle structure.

Pointer of type struct sockaddr_in * to the IP address of the originating host.

Return Values

If successful, the subroutine returns zero and initializes the array element of type RSiHandle pointed to by rhandle. If an error occurs, error text is placed in the external character array RSiEMsg and the subroutine returns a negative value.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiPathAddSetStat Subroutine

Purpose

Add a single statistics value to an already defined SpmiStatSet (SpmiStatSet Structure).

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

struct SpmiStatVals *RSiPathAddSetStat(rhandle, statset,
path)
RSiHandle rhandle;
struct SpmiStatSet *statset;
char *path;

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

statset
Must be a pointer to a structure of type struct SpmiStatSet, which was previously returned by a successful RSiCreateStatSet (RSiCreateStatSet Subroutine) subroutine call.

path
Must be the full value path name of the statistics value to add to the SpmiStatSet. The value path name must not include a terminating slash. Note that value path names never start with a slash.

Return Values

If successful, the subroutine returns a pointer to a structure of type struct SpmiStatVals (SpmiStatVals Structure). If an error occurs, NULL is returned and an error text may be placed in the external character array RSiEMsg. If you attempt to add more values to a statset than the current local buffer size allows, RSiErrno is set to RSiTooMany. If you attempt to add more values than the buffer size of the remote host's xmservd daemon allows, RSiErrno is set to RSiBadStat and the status field in the returned packet is set to too_many_values.

The external integer RSiMaxValues holds the maximum number of values acceptable with the data-consumer's buffer size.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiPathGetCx Subroutine

Purpose

Searches the context hierarchy for an SpmiCx (SpmiCx Structure) context that matches a context path name.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

cx_handle *RSiPathGetCx(rhandle, path)
RSiHandle rhandle;
char *path;

Description

The RSiPathGetCx subroutine performs the following actions:

  1. Searches the context hierarchy for a given path name of a context.
  2. Returns a handle to be used when subsequently referencing the context.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

path
A path name of a context for which a handle is to be returned. The context path name must be the full path name and must not include a terminating slash. Note that context path names never start with a slash.

Return Values

If successful, the subroutine returns a handle defined as a pointer to a structure of type cx_handle. If an error occurs, NULL is returned and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiStatGetPath Subroutine

Purpose

Finds the full path name of a statistic identified by a SpmiStatVals (SpmiStatVals Structure) pointer.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

char *RSiStatGetPath(rhandle, svp)
RSiHandle rhandle;
struct SpmiStatVals *svp;

Description

The RSiStatGetPath subroutine performs the following:

  1. Validates that the SpmiStatVals statistic identified by the second argument does exist.
  2. Returns a pointer to a character array containing the full value path name of the statistic.

The memory area pointed to by the returned pointer is freed when the RSiStatGetPath subroutine call is repeated. For each invocation of the subroutine, a new memory area is allocated and its address returned.

If the calling program needs the returned character string after issuing the RSiStatGetPath subroutine call, the program must copy the returned string to locally allocated memory before reissuing the subroutine call.

Parameters

rhandle
Must be an RSiHandle, previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

svp
Must be a handle of type struct SpmiStatVals as returned by a successful RSiPathAddSetStat (RSiPathAddSetStat Subroutine) subroutine call.

Return Values

If successful, the RSiStatGetPath subroutine returns a pointer to a character array containing the full path name of the statistic. If unsuccessful, the subroutine returns a NULL value and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiStartFeed Subroutine

Purpose

Tells xmservd to start sending data feeds for a statset.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiStartFeed(rhandle, statset, msecs)
RSiHandle rhandle;
struct SpmiStatSet *statset;
int msecs;

Description

The RSiStartFeed subroutine performs the following function:

  1. Informs xmservd of the frequency with which it is required to send data_feed packets.
  2. Tells the xmservd to start sending data_feed packets.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

statset
Must be a pointer to a structure of type struct SpmiStatSet (SpmiStatSet Structure), which was previously returned by a successful RSiCreateStatSet (RSiCreateStatSet Subroutine) subroutine call.

msecs
The number of milliseconds between the sending of data_feed packets. This number is rounded to a multiple of min_remote_int milliseconds by the xmservd daemon on the remote host. This minimum interval can be modified through the -i command line interval to xmservd.

Return Values

If successful, the subroutine returns zero; otherwise it returns -1 and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiStartHotFeed Subroutine

Purpose

Tells xmservd to start sending hot feeds for a hotset or to start checking for if exceptions or SNMP traps should be generated.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiStartFeed(rhandle, hotset, msecs)
RSiHandle rhandle;
struct SpmiHotSet *hotset;
int msecs;

Description

The RSiStartHotFeed subroutine performs the following function:

  1. Informs xmservd of the frequency with which it is required to send hot_feed packets, if the hotset is defined to generate hot_feed packets.
  2. Informs xmservd of the frequency with which it is required to check if exceptions or SNMP traps should be generated. This is only done if it is specified for the hotset that exceptions and/or SNMP traps should be generated.
  3. Tells the xmservd to start sending data_feed packets and/or start checking for exceptions or traps.

Parameters

rhandle
Must be an RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

hotset
Must be a pointer to a structure of type struc SpmiHotSet (SpmiHotSet Structure), which was previously returned by a successful RSiCreateHot (RSiCreateHotSet Subroutine) subroutine call.

msecs
The number of milliseconds between the sending of hot_feed packets and/or the number of milliseconds between checks for if exceptions or SNMP traps should be generated. This number is rounded to a multiple of min_remote_int milliseconds by the xmservd daemon on the remote host. This minimum interval can be modified through the -i command line interval to xmservd.

Return Values

If successful, the subroutine returns zero; otherwise it returns -1 and an error text may be placed in the external character array RSiEMsg.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiStopFeed Subroutine

Purpose

Tells xmservd to stop sending data feeds for a statset.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiStopFeed(rhandle, statset, erase)
RSiHandle rhandle;
struct SpmiStatSet *statset;
boolean erase;

Description

The RSiStopFeed subroutine instructs the xmservd of a remote system to:

  1. Stop sending data_feed packets for a given SpmiStatSet (SpmiStatSet Structure). If the daemon is not told to erase the SpmiStatSet, feeding of data can be resumed by issuing the RSiStartFeed (RSiStartFeed Subroutine) subroutine call for the SpmiStatSet.
  2. Optionally tells the daemon and the API library subroutines to erase all their information about the SpmiStatSet. Subsequent references to the erased SpmiStatSet are not valid.

Parameters

rhandle
Must point to a structure of type RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

statset
Must be a pointer to a structure of type struct SpmiStatSet, which was previously returned by a successful RSiCreateStatSet (RSiCreateStatSet Subroutine) subroutine call. Data feeding must have been started for this SpmiStatSet via a previous RSiStartFeed (RSiStartFeed Subroutine) subroutine call.

erase
If this argument is set to true, the xmservd daemon on the remote host discards all information about the named SpmiStatSet. Otherwise the daemon maintains its definition of the set of statistics.

Return Values

If successful, the subroutine returns zero, otherwise -1. A NULL error text is placed in the external character array RSiEMsg regardless of the subroutine's success or failure.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:

RSiStopHotFeed Subroutine

Purpose

Tells xmservd to stop sending hot feeds for a hotset and to stop checking for exception and SNMP trap generation.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h

int RSiStopFeed(rhandle, hotset, erase)
RSiHandle rhandle;
struct SpmiHotSet *hotset;
boolean erase;

Description

The RSiStopHotFeed subroutine instructs the xmservd of a remote system to:

  1. Stop sending hot_feed packets or check if exceptions or SNMP traps should be generated for a given SpmiHotSet (SpmiHotSet Structure). If the daemon is not told to erase the SpmiHotSet, feeding of data can be resumed by issuing the RSiStartHotFeed (RSiStartHotFeed Subroutine) subroutine call for the SpmiHotSet.
  2. Optionally tells the daemon and the API library subroutines to erase all their information about the SpmiHotSet. Subsequent references to the erased SpmiHotSet are not valid.

Parameters

rhandle
Must point to a structure of type RSiHandle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.

hotset
Must be a pointer to a structure of type struct SpmiHotSet, which was previously returned by a successful RSiCreateHotSet (RSiCreateHotSet Subroutine) subroutine call. Data feeding must have been started for this SpmiStatSet via a previous RSiStartHotFeed (RSiStartHotFeed Subroutine) subroutine call.

erase
If this argument is set to true, the xmservd daemon on the remote host discards all information about the named SpmiHotSet. Otherwise the daemon maintains its definition of the set of statistics.

Return Values

If successful, the subroutine returns zero, otherwise -1. A NULL error text is placed in the external character array RSiEMsg regardless of the subroutine's success or failure.

Error Codes

All RSI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType. RSi error codes are described in List of RSi Error Codes (List of SPMI Error Codes).

Implementation Specifics

This subroutine is part of the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.

Related Information

For related information, see:


[ Previous | Next | Table of Contents | Index | Library Home | Legal | ]