AFS-Monitor

 view release on metacpan or  search on metacpan

LICENSES/COPYING  view on Meta::CPAN


    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If

LICENSES/COPYING  view on Meta::CPAN


		     END OF TERMS AND CONDITIONS

	Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

LICENSES/COPYING  view on Meta::CPAN

    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19yy name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

README  view on Meta::CPAN


    Unpack the archive to create an AFS-Monitor installation directory:

        tar zxvf AFS-Monitor-0.3.3.tar.gz

    'cd' into that directory, make, test and install the modules. You
    have to specify the location of the AFS system libraries. While
    running the 'perl Makefile.PL' step you will be prompted for the
    location of the AFS system libraries.  If you want to avoid that
    query, you should specify the environment variable 'AFSPATH'
    before you start[1].  If your AFS system type is not yet known by
    the make file, please follow the printed message.

    This is the sequence of commands to build the modules:

        cd AFS-Monitor-0.3.2

        [1] this step is optional
        setenv AFSPATH 'path_to_the_AFS_system_libraries' # tcsh-shell
        export AFSPATH='path_to_the_AFS_system_libraries' # sh-shell

examples/udebug  view on Meta::CPAN

           scalar localtime(time),
           $diff);
    if (abs($diff) >= constant("MAXSKEW")) {
      print "****clock may be bad\n";
    }
    if (exists $info->{lastYesHost}) {
      $diff = $info->{now} - $info->{lastYesTime};
      printf("Last yes vote for %s was %d secs ago (%ssync site); \n",
             $info->{lastYesHost}, $diff, $info->{lastYesState} ? "" : "not ");
      $diff = $info->{now} - $info->{lastYesClaim};
      printf("Last vote started %d secs ago (at %s)\n",
              $diff,
              scalar localtime(time - $diff));
    } else {
      print "Last yes vote not cast yet \n";
    }

    printf "Local db version is %d.%d\n",
            $info->{localVersion}->{epoch},
            $info->{localVersion}->{counter};
    if ($info->{amSyncSite}) {

pod/scout.pod  view on Meta::CPAN


The number of RPC connections open between the File Server process and client
machines. This number equals or exceeds the number in the B<WorkStations>
entry (see below), because each user on the machine can have several separate
connections open at once, and one client machine can handle several users.

=item B<TotalFetchs>

The number of fetch-type RPCs (fetch data, fetch access list, and fetch
status) that client machines have made to the File Server process since the
latter started. This number is reset to zero each time the File Server process
restarts.

=item B<TotalStores>

The number of store-type RPCs (store data, store access list, and store
status) that client machines have made to the File Server process since the
latter started. This number is reset to zero each time the File Server process
restarts.

=item B<WorkStations>

The number of client machines (workstations) that have communicated with the
File Server process within the last 15 minutes. Such machines are termed
I<active>. This number is likely to be smaller than the number in the
B<CurrentConnections> entry because a single client machine can have several
connections open to one File Server.

=item B<Disk>

pod/xstat_cm_test.pod  view on Meta::CPAN

gathers about the Cache Manager. Data is returned in a predefined data
structure.

There are three acceptable values:

=over

=item B<0>

Provides profiling information about the numbers of times different internal
Cache Manager routines were called since the Cache Manager started.

=item B<1>

Reports various internal performance statistics related to the Cache Manager
(for example, statistics about how effectively the cache is being used and the
quantity of intracell and intercell data access).

=item B<2>

Reports all of the internal performance statistics provided by the B<1>

pod/xstat_fs_test.pod  view on Meta::CPAN

to return, which defines the type and amount of data the command interpreter
gathers about the File Server. Data is returned in a predefined data structure.

There are three acceptable values:

=over

=item B<0>

Provides profiling information about the numbers of times different internal
File Server routines were called since the File Server started. This value is
not currently implemented; it returns no data.

=item B<1>

Reports various internal performance statistics related to the File Server
(for example, vnode cache entries and Rx protocol activity).

=item B<2>

Reports all of the internal performance statistics provided by the 1 setting,

src/Monitor.xs  view on Meta::CPAN

         croak(buffer);
      }
      sv_setpv(sv, (char *)error_message(code));
   }
   SvIOK_on(sv);
}

/* end of error handling macros */


/* start of rxdebug helper functions */


/*
 * from src/rxdebug/rxdebug.c
 *    ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
 */

static short
rxdebug_PortNumber(aport)
   register char *aport;

src/Monitor.xs  view on Meta::CPAN

   hv_store(RXSTATS, "clock_nUpdates", 14, newSViv(clock_nUpdates), 0);
#endif
}

/* end of rxdebug helper functions */





/* start of afsmonitor helper functions */

/*
 * from src/afsmonitor/afsmonitor.c
 *    ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
 */

#define FS 1    /* for misc. use */
#define CM 2    /* for misc. use */
#define CFG_STR_LEN 80  /* max length of config file fields */
#define NUM_XSTAT_FS_AFS_PERFSTATS_LONGS 66 /* number of fields (longs)

src/Monitor.xs  view on Meta::CPAN

#define FS_NUM_DATA_CATEGORIES 9    /* # of fs categories */
#define CM_NUM_DATA_CATEGORIES 16   /* # of cm categories */


/*
 * from src/xstat/xstat_fs.c
 *    ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
 *

/*
 * We have to pass a port to Rx to start up our callback listener
 * service, but 7001 is already taken up by the Cache Manager.  So,
 * we make up our own.
 */
#define XSTAT_FS_CBPORT 7101


/*
 * from src/afsmonitor/afsmon-output.c
 *    ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
 */

src/Monitor.xs  view on Meta::CPAN

   }

   if ((strcasecmp(arg1, "fs") != 0) && (strcasecmp(arg1, "cm") != 0)) {
      sprintf(buffer,
              "Second argument of \"show\" directive should be \"fs\" or \"cm\"");
      return (-1);
   }

   /* Each entry can either be a variable name or a section/group name. Variable
    * names are listed in xx_varNames[] and section/group names in xx_categories[].
    * The section/group names in xx_categiries[] also give the starting/ending
    * indices of the variables belonging to that section/group. These indices
    * are stored in order in xx_Display_map[] and displayed to the screen in that
    * order. */

   /* To handle duplicate "show" entries we keep track of what what we have
    * already marked to show in the xx_showFlags[] */

   if (strcasecmp(arg1, "fs") == 0) {   /* its a File Server entry */
      /* mark that we have to show only what the user wants */
      *fs_showDefault = 0;

src/Monitor.xs  view on Meta::CPAN

               break;
            }
         }

         if (!found) {  /* typo in section/group name */
            sprintf(buffer, "Could not find section/group name %s", arg2);
            return (-1);
         }
      }

        /* if it is a group name, read its start/end indices and fill in the
         * fs_Display_map[]. */

      if (strcasestr(arg2, "_group") != (char *)NULL) {

         if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_FS_STAT_ENTRIES ||
             toIdx > NUM_FS_STAT_ENTRIES)
            return (-2);
         for (j = fromIdx; j <= toIdx; j++) {
            fs_showFlags[j] = 1;
         }

src/Monitor.xs  view on Meta::CPAN


         if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_CM_STAT_ENTRIES
             || toIdx > NUM_CM_STAT_ENTRIES)
            return (-10);
         for (j = fromIdx; j <= toIdx; j++) {
            cm_showFlags[j] = 1;
         }
      }

      /* if it is a section name, get the count of number of groups in it and
       * for each group fill in the start/end indices in the cm_Display_map[] */

      else if (strcasestr(arg2, "_section") != (char *)NULL) {
         /* fromIdx is actually the number of groups in thi section */
         numGroups = fromIdx;
         /* for each group in section */
         while (idx < CM_NUM_DATA_CATEGORIES && numGroups) {
            sscanf(cm_categories[idx], "%s %d %d", catName, &fromIdx, &toIdx);

            if (strcasestr(catName, "_group") != (char *) NULL) {
               if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_CM_STAT_ENTRIES

src/Monitor.xs  view on Meta::CPAN

            /* now skip over 4 words - this is done by first
             * skipping leading blanks then skipping a word */
            for (i = 0; i < 4; i++) {
               while (isspace(*handlerPtr))
                  handlerPtr++;
               while (!isspace(*handlerPtr))
                  handlerPtr++;
            }
            while (isspace(*handlerPtr))
               handlerPtr++;
            /* we how have a pointer to the start of the handler
             * name & args */
         }
         else
            handlerPtr = arg4;  /* empty string */

         if (strcasecmp(arg1, "fs") == 0)
            code = my_store_threshold(1,    /* 1 = fs */
                                      arg2, arg3, handlerPtr,
                                      &global_fsThreshCount, *FSnameList,
                                      last_fsHost, *numFS, buff2);

src/Monitor.xs  view on Meta::CPAN

         return (-2);
      }
      /*
       * Bump the current xstat_fs connection to set up.
       */
      curr_conn++;

   }    /*for curr_srv */


   va_start(argp, buffer);
   code =
      my_xstat_fs_LWP(ProbeHandler, xstat_fs_ConnInfo, xstat_fs_numServers,
                      xstat_fs_collIDP, xstat_fs_numCollections, buffer,
                      argp);
   va_end(argp);

   if (code) {
      return (code);
   }
   my_xstat_fs_Cleanup(1, xstat_fs_numServers, xstat_fs_ConnInfo, buff2);

src/Monitor.xs  view on Meta::CPAN

         return (-2);
      }
      /*
       * Bump the current xstat_fs connection to set up.
       */
      curr_conn++;

   }    /*for curr_srv */


   va_start(argp, buffer);
   code =
      my_xstat_cm_LWP(ProbeHandler, xstat_cm_ConnInfo, xstat_cm_numServers,
                      xstat_cm_collIDP, xstat_cm_numCollections, buffer,
                      argp);
   va_end(argp);

   if (code) {
      return (code);
   }
   my_xstat_cm_Cleanup(1, xstat_cm_numServers, xstat_cm_ConnInfo, buff2);

src/Monitor.xs  view on Meta::CPAN

   if (scout_debugfd)
      fprintf(scout_debugfd, "[%s] Callback listener created\n", rn);

   /*
    * Start up the AFS callback service.
    */
   if (scout_debugfd)
      fprintf(scout_debugfd, "[%s] Starting up callback listener.\n", rn);
   rx_StartServer(0 /*Don't donate yourself to LWP pool */ );

   /* start probe */
   code = my_fsprobe_LWP(a_numServers, *fsprobe_ConnInfo, fsprobe_Results,
                         fsprobe_statsBytes, fsprobe_probeOKBytes,
                         scout_debugfd, RETVAL, buffer);
   if (code)
      return (code);

   if (conn_err)
      return (-2);
   else
      return (0);

src/afsmon-labels.h  view on Meta::CPAN

"StoreData_xfers_bucket4",
"StoreData_xfers_bucket5",
"StoreData_xfers_bucket6",
"StoreData_xfers_bucket7",
"StoreData_xfers_bucket8"
};

/* file server data classification */
/* Data is classified into sections and each section into one or more
groups. The integer after a section name specifies the number of groups
contained in it. The integers after a group name specify the starting and
ending positional indices to fs_varNames[]. Unimportant information
is placed at the end of the section. */

char *fs_categories[] = {
"PerfStats_section 5",
"VnodeCache_group 1 13",
"Directory_group 14 16",
"Rx_group 17 57",
"HostModule_group 58 65",
"misc_group 0 0",		/* numPerfCalls */

src/afsmon-labels.h  view on Meta::CPAN

"replicatedRefs",
"numReplicasAccessed",
"maxReplicasPerRef",
"refFirstReplicaOK"
};


/* Cache Manager data classification */
/* Data is classified into sections and each section into one or more
groups. The integer after a section name specifies the number of groups
contained in it. The integers after a group name specify the starting and
ending positional indices to fs_varNames[]. Unimportant information
is placed at the end of the section. */

char *cm_categories[] = {
"PerfStats_section 2",
"PerfStats_group 4 39",
"misc_group 0 3",
"Server_UpDown_section 4",
"FS_upDown_SC_group 40 64",
"FS_upDown_DC_group 65 89",

src/ppport.h  view on Meta::CPAN

}
#    else
#      define newRV_noinc(sv)    \
        ((PL_Sv=(SV*)newRV(sv), SvREFCNT_dec(sv), (SV*)PL_Sv)
#    endif
#  endif
#endif

/* Provide: newCONSTSUB */

/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 63))

#if defined(NEED_newCONSTSUB)
static
#else
extern void newCONSTSUB _((HV * stash, char * name, SV *sv));
#endif

#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
void

src/ppport.h  view on Meta::CPAN

	PL_curcop->cop_line = PL_copline;

	PL_hints &= ~HINT_BLOCK_SCOPE;
	if (stash)
		PL_curstash = PL_curcop->cop_stash = stash;

	newSUB(

#if (PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22))
     /* before 5.003_22 */
		start_subparse(),
#else
#  if (PERL_VERSION == 3) && (PERL_SUBVERSION == 22)
     /* 5.003_22 */
     		start_subparse(0),
#  else
     /* 5.003_23  onwards */
     		start_subparse(FALSE, 0),
#  endif
#endif

		newSVOP(OP_CONST, 0, newSVpv(name,0)),
		newSVOP(OP_CONST, 0, &PL_sv_no),   /* SvPV(&PL_sv_no) == "" -- GMB */
		newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
	);

	PL_hints = oldhints;
	PL_curcop->cop_stash = old_cop_stash;



( run in 0.486 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )