RSTAT(3R)

NAME
rstat - get performance data from a remote kernel

DESCRIPTION
The rstat() protocol gathers statistics from a remote kernel. (Statistics are available on items such as paging, swapping and cpu utilization.)

RPC INFO
program number:
	RSTATPROG

xdr routines:
	xdr_stats(xdrs, statp);
		XDR *xdrs;
		struct stats *statp;
	xdr_statusswtch(xdrs, statp);
		XDR *xdrs;
		struct statsswtch *statp;
	xdr_statstime(xdrs, statp);
		XDR *xdrs;
		struct statstime *statp;
procs:
	RSTATPROC_STATS
	RSTATPROC_HAVEDISK

versions:
	RSTATVERS_ORIG
	RSTATVERS_SWTCH
	RSTATVERS_TIME
structures:
	struct stats {                          /* version 1 */
		int cp_time[CPUSTATES];
		int dk_xfer[DK_NDRIVE];
		unsigned v_pgpgin;      /* these are cumulative sum */
		unsigned v_pgpgout;
		unsigned v_pswpin;
		unsigned v_pswpout;
		unsigned v_intr;
		int if_ipackets;
		int if_ierrors;
		int if_opackets;
		int if_oerrors;
		int if_collisions;
	};
	struct statsswtch {                             /* version 2 */
		int cp_time[CPUSTATES];
		int dk_xfer[DK_NDRIVE];
		unsigned v_pgpgin;      /* these are cumulative sum */
		unsigned v_pgpgout;
		unsigned v_pswpin;
		unsigned v_pswpout;
		unsigned v_intr;
		int if_ipackets;
		int if_ierrors;
		int if_opackets;
		int if_oerrors;
		int if_collisions;
		unsigned v_swtch;
		long avenrun[3];
		timeval_t boottime;
	};
	struct statstime {                              /* version 3 */
		int cp_time[CPUSTATES];
		int dk_xfer[DK_NDRIVE];
		unsigned v_pgpgin;      /* these are cumulative sum */
		unsigned v_pgpgout;
		unsigned v_pswpin;
		unsigned v_pswpout;
		unsigned v_intr;
		int if_ipackets;
		int if_ierrors;
		int if_opackets;
		int if_oerrors;
		int if_collisions;
		unsigned v_swtch;
		long avenrun[3];
		timeval_t boottime;
		timeval_t curtime;
	};

PROGRAMMING
#include <rpcsvc/rstat.h>

havedisk(host)
char *host;

rstat(host, statp)
char *host;
struct statstime *statp;

havedisk() returns 1 if host has a disk, 0 if it does not, and -1 if it cannot be determined whether host has a disk. rstat() fills in the statstime structure for host and returns 0 if it was successful. The following XDR routines are available in librpcsvc:
xdr_statstime
xdr_statsswtch
xdr_stats

SEE ALSO
rup(1C), rstatd(8C)