perfmon, and rstat

From: <judith_at_npac.syr.edu>
Date: Mon, 13 Mar 95 13:16:53 EST

I have a user who wants to use the rstat system call to get statistics
across the network from an alpha, to be displayed on some other unix box.
He's modeled his code on "perfmon", using calls to rstat to startup rstatds
on the nodes to be watched. We were able to get rstatd sort of running by
uncommenting its entry in /etc/inetd.conf and restarting inetd, but when
I try to access the node from another node, using the code, I get:

Nodename: Permission denied

Any ideas as to what to tweak to allow startup of rstatd by a user, remotely?
I'll append the gist of the code at the bottom (with much deleted for
brevity - just saved references to rstat, mostly)

Many thanks in advance...

Judith Reed
judith_at_npac.syr.edu
systems_at_npac.syr.edu
*****************************************************************************
        :
#include <rpcsvc/rstat.h>
        :
char **hosts;
struct statstime *orig, *new;
struct mystat {
        int usr;
        int sys;
        int pkt;
        int page;
        int disk;
} *save;
int secs;
int n;
        :
catch() {}

main(ac, av)
        char **av;
{
        int i;
        char *calloc();
        struct itimerval it;
        time_t clock;

        if (isdigit(av[ac - 1][0])) {
                secs = atoi(av[ac - 1]);
                ac--;
        } else {
                secs = SLPDEFAULT;
        }
        hosts = (char**)calloc(ac, sizeof(char *));
        orig = (struct statstime*)calloc(ac, sizeof(struct statstime));
        new = (struct statstime*)calloc(ac, sizeof(struct statstime));
        save = (struct mystat*)calloc(ac, sizeof(struct mystat));

        /*
         * Go through it once to fire up all the rstatd's.
         */
        for (i = 1; i < ac; ++i) {
                if (rstat(av[i], &orig[i - 1]) == 0) {
                        hosts[n++] = av[i];
                } else {
                        perror(av[i]);
                        exit(1);
                }
        }

        :

        for (i = 0; i < ac - 1; ++i) {
                rstat(hosts[i], &orig[i]);
        }
        :
getstats(i)
{
        int y, u, s, d, pkt, pg, pos;

        if (rstat(hosts[i], &new[i]) != 0) {
                perror(hosts[i]);
                exit(1);
        }
Received on Mon Mar 13 1995 - 13:18:11 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT