rstat rpc call example - source

rstatd Daemon

The rstatd daemon is an rpc server that runs on each machine and can be used to retrieve performance information about that system. Normally it is invoked from the command line using the command rup hostname.

The source code below is for a client that can invoke the rpc directly. The interface to the rstat rpc may be found in /usr/include/rpcsvc/rstat.x. I used rpcgen to generate the .h file and the rstat_xdr.c routines that do the conversion of the returned data.

Sample Procedures

  • Makefile - used to compile and link client.
  • rstat.x - the rpcgen interface file
  • rstat.h - generated by rpcgen
  • callrstat.c - my client program
  • rstat_xdr.c - xdr routines generated by rpcgen.