AFS-Monitor

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

This is the README file for the Perl extension module AFS::Monitor (Version 0.3.3)


DESCRIPTION
    The AFS::Monitor module is a dynamically loadable extension to
    Perl. It gives the AFS user and administrator access to most of the
    AFS monitoring and debugging functions, allowing you to make these calls
    directly from Perl, rather than processing the output of a command.


REQUIREMENTS
    Before you can build the AFS module you need to have the
    following installed on your system:

        * Perl 5.6.1 or newer (haven't tested on any older versions)
        * system libraries for OpenAFS 1.2.x and newer (it is unknown
	whether IBM AFS wil work)

examples/Meltdown.pl  view on Meta::CPAN

#!/usr/bin/perl
#
# Meltdown.pl - Used to collect stats on running AFS process with rxdebug.
#
# Original Implementation:
#	Unknown - Meltdown.csh, Meltdown.awk
#
# Change History:
#	Jul 02, 2002 - Rex Basham - Added check for wproc, left out during the
#				    original conversion from awk/csh scripts.
#	Mar 21, 2002 - Rex Basham - Merged original csh and awk scripts
#	                            and converted to perl
#	Mar 23, 2002 - Rex Basham - Fixed the display format and added

examples/Meltdown.pl  view on Meta::CPAN

#	Meltdown.pl -s point -p 7000 -t 300
#
#	Check the server 'point' on port '7000' with 5 minutes between
#	rxdebug commands.
#

use blib;
use AFS::Monitor;

sub Usage {
	print STDERR "\n\n$progName: collect rxdebug stats on AFS process.\n";
	print STDERR "usage: $progName [options]\n";
	print STDERR "options:\n";
	print STDERR " -s <server>    (required parameter, no default).\n";
	print STDERR " -p <port>      (default: 7000).\n";
	print STDERR " -t <interval>  (default: 1200 seconds).\n";
	print STDERR " -C             \n";
	print STDERR " -h             (help: show this help message).\n\n";
	print STDERR "Example: $progName -s point -p 7000\n";
	print STDERR "Collect statistics on server point for port 7000\n";
	print STDERR "Refresh interval will default to 20 minutes (1200 seconds)\n\n";

examples/rxdebug  view on Meta::CPAN

          if ($val->{connections}->[$i]->{callFlags}->[$j] & constant("RX_CALL_WAIT_WINDOW_ALLOC")) {
            print " window_alloc";
          }
          if ($val->{connections}->[$i]->{callFlags}->[$j] & constant("RX_CALL_WAIT_WINDOW_SEND")) {
            print " window_send";
          }
          if ($val->{connections}->[$i]->{callFlags}->[$j] & constant("RX_CALL_WAIT_PACKETS")) {
            print " wait_packets";
          }
          if ($val->{connections}->[$i]->{callFlags}->[$j] & constant("RX_CALL_WAIT_PROC")) {
            print " waiting_for_process";
          }
          if ($val->{connections}->[$i]->{callFlags}->[$j] & constant("RX_CALL_RECEIVE_DONE")) {
            print " receive_done";
          }
          if ($val->{connections}->[$i]->{callFlags}->[$j] & constant("RX_CALL_CLEARED")) {
            print " call_cleared";
          }
        }
        if ($val->{connections}->[$i]->{callOther}->[$j] & constant("RX_OTHER_IN")) {
          print ", has_input_packets";

pod/Monitor.pod  view on Meta::CPAN

Reports status of cache manager and cache entries on a particular AFS
client machine. See L<cmdebug(1)>

=item B<rxdebug>

Provides debugging trace of Rx activity for a specified server or client
machine. See L<rxdebug(1)>

=item B<scout>

Gathers statistics from the File Server processes running on the specified
machines. See L<scout(1)>

=item B<udebug>

Reports the status of the Ubik process associated with a database server
process. See L<udebug(1)>

=item B<xstat_cm_test>

Gathers the specified data collections associated with the specified Cache
Manager. See L<xstat_cm_test(1)>

=item B<xstat_fs_test>

Gathers the specified data collections associated with the specified File
Server process. See L<xstat_fs_test(1)>

=back

=head1 COMPATIBILITY

The configurations that this package has been tested on are listed below:

  OS              @sys            Perl            	OpenAFS
  -----------------------------------------------------------------------------
  FC5             amd64_linux26   v5.8.8			1.4.2-beta1

pod/afsmon_stats.pod  view on Meta::CPAN

=item *

numCellsContacted: Number of cells contacted.

=back

=head2 Server Up/Down Statistics Section (Server_UpDown_section)

File Server Up/Down Statistics in Same Cell Group (FS_upDown_SC_group)

Note: The records referred to in this section are the internal records kept by the afsmonitor program to track the processes from which data is being gathered.

=over

=item *

fs_sc_numTtlRecords: Number of fileserver records, active or inactive.

=item *

fs_sc_numUpRecords: Number of (active) fileserver records currently marked up.

pod/afsmonitor.pod  view on Meta::CPAN

Include the B<output> argument to name the file into which the
B<afsmonitor> function writes all of the statistics it collects.

The output file is in ASCII format and records the same
information as is returned in the File Server and Cache Manager
data structures. The output file has the following format:

   time  host_name  CM|FS   list_of_measured_values

and specifies the time at which the list_of_measured_values were
gathered from the Cache Manager (CM) or File Server (FS) process
housed on host_name. On those occasion where probes fail, the
value -1 is reported instead of the list_of_measured_values.

If the administrator usually reviews the output file manually,
rather than using it as input to an automated analysis program or
script, including the B<detail> flag formats the data in a more
easily readable form.

=head1 THE CONFIGURATION FILE

pod/rxdebug.pod  view on Meta::CPAN

                 port         => 7001,
                );

=head1 DESCRIPTION

The B<rxdebug> function provides a trace of Rx activity for the
server or client machine named by the B<servers> argument. Rx
is AFS's proprietary remote procedure call (RPC) protocol,
so this function enables the issuer to check the status of
communication between the Cache Manager or an AFS server
process (as specified with the B<port> argument) on the
machine and one or more processes on other machines.

=head1 OPTIONS

=over

=item B<servers>

Specifies the machine that is running the Cache Manager or server process for
which to trace Rx activity. Provide the machine's IP address in dotted decimal
format, its fully qualified host name (for example, B<fs1.abc.com>), or the
shortest abbreviated form of its host name that distinguishes it from other
machines. Successful use of an abbreviated form depends on the availability of
a name resolution service (such as the Domain Name Service or a local host
table) at the time the function is issued.

=item B<port>

Specifies the process for which to trace Rx activity. Omit this argument to
specify the File Server (B<fileserver> process), or provide one of the
following values:

=over

=item *

B<7000> for the File Server (B<fileserver> process)

=item *

B<7001> for the Cache Manager (specifically, its callback interface)

=item *

B<7002> for the Protection Server (B<ptserver> process)

=item *

B<7003> for the Volume Location (VL) Server (B<vlserver> process)

=item *

B<7004> for the Authentication Server (B<kaserver> process)

=item *

B<7005> for the Volume Server (B<volserver> process)

=item *

B<7007> for the BOS Server (B<bosserver> process)

=item *

B<7008> for the Update Server (B<upserver> process)

=item *

B<7009> for the NFS/AFS Translator's B<rmtsysd> daemon

=item *

B<7021> for the Backup Server (B<buserver> process)

=item *

B<7025> through B<65535> for the Backup Tape Coordinator (B<butc> process) that
has the port offset number derived by subtracting 7025 from this value

=back

=item B<nodally>

Produces output only for connections that are not in dally mode. Dally mode is
a state in which the connection is idle or waiting.

=item B<allconnections>

Produces output for all connections, even inactive ones. By default, the output
includes information only for connections that are active or in dally mode.

=item B<rxstats>

Produces detailed statistics about Rx history and performance (for example,
counts of the number of packets of various types the process has read and sent,
calculations of average and minimum roundtrip time, and so on).

=item B<onlyserver>

Produces output only for connections in which the process designated by the
B<port> argument is acting as the server.

=item B<onlyclient>

Produces output only for connections in which the process designated by the
B<port> argument is acting as the client.

=item B<onlyport>

Produces output only for connections between the process designated by the
B<port> argument and the specified port on any another machine. Use the same
port identifiers as for the B<port> argument.

=item B<onlyhost>

Produces output only for connections between the process designated by the
B<port> argument and any process on the specified machine. To identify the
machine, use the same notation as for the B<servers> argument.

=item B<onlyauth>

Produces output only for connections that are using the specified
authentication level. Provide one of the following values:

=over

=item *

pod/rxdebug.pod  view on Meta::CPAN


=item *

B<none> for unauthenticated connections (equivalents are B<null>, B<noauth>,
and B<unauth>)

=back

=item B<version>

Reports the AFS build level of the binary file for the process designated by
the B<port> argument (or of the kernel extensions file for port 7001, the Cache
Manager's callback interface). Any other options combined with this one are
ignored.

=item B<noconns>

Produces only the standard statistics that begin the output produced by every
option (other than B<version>), and peer structure information if the B<peers>
option was selected, without reporting on any connections.

=item B<peers>

Outputs information from the I<peer structure> maintained for each port on
another machine to which the process designated by the B<port> argument has a
connection. There is information about roundtrip time and numbers of packets
sent and received, for example.

=item B<long>

Outputs additional information from the I<peer structure> maintained for each
port on another machine to which the process designated by the B<port> argument
has a connection. Only use this with the B<peers> argument.

=back

=head1 OUTPUT

The return value is a reference to a hash containing the
requested information. The keys that the hash may contain, along
with a short description of their values, are listed below:

pod/scout.pod  view on Meta::CPAN


  $scout = scout(server   => "serverName1");

  $scout = scout(server   => ["serverName1", "serverName2"],
                 basename => "example.com",
                 debug    => "debug_out/debug.file"
                );

=head1 DESCRIPTION

The B<scout> function gathers statistics from the File Server process running
on each machine specified with the B<server> argument. The B<Output> section
explains the meaning of the statistics.

=head1 OPTIONS

=over

=item B<server>

String with one name or reference to an array with names of one or
more machines from which to gather File Server statistics.
Specifies each file server machine running a File Server process to monitor.
Provide each machine's fully qualified hostname unless the B<basename>
argument is used. In that case, specify only the unique initial part of each
machine name, omitting the domain name suffix (the basename) common to all the
names. It is also acceptable to use the shortest abbreviated form of a host
name that distinguishes it from other machines, but successful resolution
depends on the availability of a name resolution service (such as the Domain
Name Service or a local host table) at the time the command is issued.

=item B<basename>

pod/scout.pod  view on Meta::CPAN


=item B<hostName>

This hash entry contains the name of the file server that this array entry
represents.

=item B<probeOK>

The value of this entry will be 1 if the probe was successful, and 0 if the
probe failed and was unable to gather any statistics for this File Server
process.

=item B<stats>

The value of this entry will be a reference to a hash containing all of the
statistics gathered, unless the probe failed, in which case the b<stats> key
will not exist. Some of the statistics contained in this hash are described
below:

=over

=item B<CurrentConnections>

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>

A reference to an array containing an entry for each AFS disk partition on the
file server machine, up to 26 partitions. Each entry is a reference to a hash,
containing three entries:

pod/udebug.pod  view on Meta::CPAN

#
# Copyright © 2004 Alf Wachsmann <alfw@slac.stanford.edu> and
#                  Elizabeth Cassell <e_a_c@mailsnare.net>
#
# This library is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#------------------------------------------------------------------------------

=head1 NAME

B<udebug> - Reports status of Ubik process associated with a database server process

=head1 SYNOPSIS

  use AFS::Monitor qw(udebug);

  my $udb = udebug(server => "hostName",
                   port   => 7002,
                   long   => 1
                  );

  $udb = udebug(server => "hostName",
                port   => 7021
               );

=head1 DESCRIPTION

The B<udebug> function returns the status of the lightweight
Ubik process for the database server process identified by
the B<port> argument that is running on the database server
machine named by the B<server> argument. The output identifies
the machines where peer database server processes are running,
which of them is the synchronization site (Ubik coordinator),
and the status of the connections between them.

=head1 OPTIONS

=over

=item B<server>

Names the database server machine that is running the process
for which to collect status information. Provide the machine's
IP address in dotted decimal format, its fully qualified host
name (for example, B<fs1.abc.com>), or the shortest abbreviated
form of its host name that distinguishes it from other machines.
Successful use of an abbreviated form depends on the availability
of a name resolution service (such as the Domain Name Service
or a local host table) at the time the function is issued.

=item B<port>

Identifies the database server process for which to collect
status information, either by its process name or port number.
Provide one of the following values:

=over

=item *

B<buserver> or B<7021> for the Backup Server

=item *

pod/udebug.pod  view on Meta::CPAN

=item B<now>

The time according to the clock on the database server machine
specified by the B<server> argument, measured in seconds since the
Epoch (00:00:00 UTC, January 1, 1970). For correct Ubik operation,
the database server machine clocks must agree on the time.

=item B<lastYesHost>, B<lastYesTime> and B<lastYesClaim>

If the B<udebug> function was issues during the coordinator election
process and voting has not yet begun, this key will not exist.
Otherwise, this key indicates which peer this Ubik process last voted
for as coordinator (it can vote for itself). The key B<lastYesTime>
contains the time (in seconds since the Epoch), of the vote. The key
B<lastYesClaim> contains the time (in seconds since the Epoch) that the
Ubik coordinator requested confirming votes from the secondary sites.
Usually, the B<lastYesTime> and B<lastYesClaim> values are the same;
a difference between them can indicate clock skew or a slow network
connection between the two database server machines. A small difference
is not harmful.

=item B<localVersion>

A reference to a hash containing information about the current
version number of the database maintained by this Ubik process.
It has two entries:

=over

=item B<epoch>

This field is based on a timestamp that reflects when the database
first changed after the most recent coordinator election.

=item B<counter>

This field indicates the number of changes since the election.

=back

=item B<amSyncSite>, B<syncSiteUntil> and B<nServers>

Indicates whether the Ubik process is the coordinator or not.
If there are multiple database sites, and the B<server> argument
names the coordinator (synchronization site), then the B<syncSiteUntil>
entry indicates the time (in seconds since the Epoch) the site will
remain coordinator even if the next attempt to maintain quorum fails.
The entry B<nServers> indicates how many sites are participating
in the quorum.

=item B<recoveryState>

If there are multiple database sites, and the B<server> argument

pod/udebug.pod  view on Meta::CPAN

identify the transaction.

=item B<isClone>

True if the machine named by the B<server> argument is a clone, which can
never become sync site.

=item B<lowestHost> and B<syncHost>

The B<lowestHost> is the lowest IP address of any peer from which the
Ubik process has received a message recently, whereas the B<syncHost>
is the IP address of the current coordinator. If they differ, the machine
with the lowest IP address is not currently the coordinator. The Ubik
process continues voting for the current coordinator as long as they
remain in contact, which provides for maximum stability. However, in
the event of another coordinator election, this Ubik process votes for
the B<lowestHost> site instead (assuming they are in contact), because
it has a bias to vote in elections for the site with the lowest IP address.

=item B<lowestTime>

The time (in seconds since the Epoch) that the B<lowestHost> (see above) was set.

=item B<syncTime>

The time (in seconds since the Epoch) that the B<syncHost> (see above) was set.

pod/udebug.pod  view on Meta::CPAN

A hash reference containing the entries B<epoch> and B<counter>,
indicating the version number of the database it is maintaining.

=item B<isClone>

True if the site is only a clone.

=item B<lastVoteTime>

The time, in seconds since the Epoch, the coordinator last received a vote
message from the Ubik process at the site.
If the B<udebug> function is issued during the coordinator election process
and voting has not yet begun, this will be 0.

=item B<lastBeaconSent>

The time, in seconds since the Epoch, the coordinator last requested a vote message.
If the B<udebug> function is issued during the coordinator election process
and voting has not yet begun, this will be 0.

=item B<lastVote>

True if the last vote was yes; false if the last vote was no.

=item B<currentDB>

1 if the site has the database with the highest version number, 0 if it does not.

=item B<up>

1 if the Ubik process at the site is functioning correctly, 0 if it is not.

=item B<beaconSinceDown>

1 if the site has responded to the coordinator's last request for votes, 0 if it has not

=back

Including the B<long> flag produces peer entries even when the B<server>
argument names a secondary site, but in that case only the ip address is
guaranteed to be accurate. For example, the value in the B<remoteVersion> field

pod/xstat_fs_test.pod  view on Meta::CPAN

#
# Copyright © 2004 Alf Wachsmann <alfw@slac.stanford.edu> and
#                  Elizabeth Cassell <e_a_c@mailsnare.net>
#
# This library is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#------------------------------------------------------------------------------

=head1 NAME

B<xstat_fs_test> - Gathers data collections from the File Server process.

=head1 SYNOPSIS

  use AFS::Monitor qw(xstat_fs_test);

  my $result = xstat_fs_test(
                             fsname => ["hostName1", "hostName2"],
                             collID => [0, 1, 2],
                            );

pod/xstat_fs_test.pod  view on Meta::CPAN

      print "probe successful\n";
    } else {
      print "probe failed\n";
    }
  }

=head1 DESCRIPTION

The B<xstat_fs_test> function tests the routines in the B<libxstat_fs.a>
library and returns the data collections associated with the File Server (the
fs process).

=head1 OPTIONS

=over

=item B<fsname>

String with one name or reference to an array with names of one or
more machines from which to monitor the File Server process.

=item B<collID>

Integer or reference to an array where each entry specifies each data collection
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

src/Monitor.pm  view on Meta::CPAN

	else {
	    *$AUTOLOAD = sub { $val };
	}
    }
    goto &$AUTOLOAD;
}

bootstrap AFS::Monitor $VERSION;

# Preloaded methods go here.  Autoload methods go after __END__, and are
# processed by the autosplit program.

1;
__END__

src/Monitor.xs  view on Meta::CPAN





/*
 * 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 $");
 */

int
my_process_config_file(a_config_filename, numFS, numCM, lastHostType,
                       last_hostEntry, fs_showDefault, cm_showDefault,
                       fs_showFlags, cm_showFlags, FSnameList, CMnameList)
   char *a_config_filename;
   int *numFS;
   int *numCM;
   int *lastHostType;
   struct afsmon_hostEntry **last_hostEntry;
   int *fs_showDefault;
   int *cm_showDefault;
   short *fs_showFlags;

src/Monitor.xs  view on Meta::CPAN

                               fs_showFlags, cm_showFlags, buff2);
      }
      else {
         /* fprintf(STDERR, " - unknown entry\n"); */
         sprintf(buff2, "Unknown opcode %s", opcode);
         code = 1;
      }

      if (code) {
         sprintf(buff1,
                 "Error processing config file line %d (\"%s %s %s %s %s\"). %s",
                 linenum, opcode, arg1, arg2, arg3, arg4, buff2);
         error_in_config = 1;
         BSETCODE(10, buff1);
         return (-1);
      }
   }
   /* fprintf(STDERR, "got to end of file.\n"); */

   if (error_in_config) {
      sprintf(buff1, "Error in config file. %s", buff2);

src/Monitor.xs  view on Meta::CPAN

                                      &global_cmThreshCount, *CMnameList,
                                      last_cmHost, *numCM, buff2);

         else {
            sprintf(buff1, "Programming error 6");
            BSETCODE(40, buff1);
            return (-1);
         }
         if (code) {
            sprintf(buff1,
                    "Error processing config file line %d (\"%s %s %s %s %s\"): Failed to store threshold. %s",
                    linenum, opcode, arg1, arg2, arg3, arg4, buff2);
            BSETCODE(45, buff1);
            return (-1);
         }
      }
   }

   fclose(configFD);
   return (0);
}   /* my_process_config_file() */




/*
 * 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 $");
 */

void

src/Monitor.xs  view on Meta::CPAN

         goto tryold;
      }
      else if (!code) {
         newvolserver = 2;
      }
   }
   if (!code) {
      *cntp = partEnts.partEntries_len;
      if (*cntp > VOLMAXPARTS) {
         warn
            ("Warning: number of partitions on the server too high %d (process only %d)\n",
             *cntp, VOLMAXPARTS);
         *cntp = VOLMAXPARTS;
      }
      for (i = 0; i < *cntp; i++) {
         ptrPartList->partId[i] = partEnts.partEntries_val[i];
         ptrPartList->partFlags[i] = PARTVALID;
      }
      free(partEnts.partEntries_val);
   }
 out:

src/Monitor.xs  view on Meta::CPAN

    afs_int32 *collIDP = 0;     /* ptr to collection ID */
    int numCollIDs = 0;         /* number of collection IDs */
    /* end of from afsmon_execute() */

    AV* FILESERV = newAV(); /* File Servers */
    AV* CACHEMAN = newAV(); /* Cache Managers */

    struct afsmon_hostEntry *FSnameList=0;
    struct afsmon_hostEntry *CMnameList=0;

    /* initialize showFlags for processing "show" directives in config file */
    for(i=0; i<NUM_FS_STAT_ENTRIES; i++)
      fs_showFlags[i] = 0;
    for(i=0; i<NUM_CM_STAT_ENTRIES; i++)
      cm_showFlags[i] = 0;

    /* parse arguments */
    num_args = hv_iterinit(args);
    /* fprintf(STDERR, "[afsmonitor] Parsing args now: %d\n", num_args); */
    while (num_args--) {
      value = hv_iternextsv(args, &key, &keylen);

src/Monitor.xs  view on Meta::CPAN

                           &global_cmThreshCount, CMnameList, thresh_host,
                           numCM, buff2);
        if(code) {
          sprintf(buffer, "Unable to store threshold %s. %s", thresh_name, buff2);
          BSETCODE(code, buffer);
          XSRETURN_UNDEF;
        }
      }
    }

    /* process configuration file */
    if(config_filename) {
      code = my_process_config_file(config_filename, &numFS, &numCM, &lastHostType,
                                 &last_hostEntry, &fs_showDefault, &cm_showDefault,
                                 fs_showFlags, cm_showFlags, &FSnameList, &CMnameList);
      if(code == -1)
        XSRETURN_UNDEF;
    }

  /* from afsmon_execute() */

    /* process file server entries */
    if (numFS) {
    /* Allocate an array of sockets for each fileserver we monitor */

      FSsktbytes = numFS * sizeof(struct sockaddr_in);
      FSSktArray = (struct sockaddr_in *) malloc(FSsktbytes);
      if (FSSktArray == (struct sockaddr_in *) NULL) {
        sprintf(buffer,"cannot malloc %d sockaddr_ins for fileservers", numFS);
        BSETCODE(-1, buffer);
        XSRETURN_UNDEF;
      }

src/Monitor.xs  view on Meta::CPAN


      code = my_xstat_fs_Init(my_afsmon_FS_Handler, numFS, FSSktArray, numCollIDs,
                              collIDP, buff2, output_filename, detailed, FILESERV,
                              FSnameList, fs_showFlags, fs_showDefault);

      if (code) {
        sprintf(buffer,"my_xstat_fs_Init() returned error. %s", buff2);
        BSETCODE(125, buffer);
        XSRETURN_UNDEF;
      }
    }  /* end of process fileserver entries */

    /* process cache manager entries */
    if (numCM) {
    /* Allocate an array of sockets for each fileserver we monitor */

      CMsktbytes = numCM * sizeof(struct sockaddr_in);
      CMSktArray = (struct sockaddr_in *) malloc(CMsktbytes);
      if (CMSktArray == (struct sockaddr_in *) NULL) {
        sprintf(buffer,"cannot malloc %d sockaddr_ins for CM entries", numCM);
        BSETCODE(-1, buffer);
        XSRETURN_UNDEF;
      }

src/Monitor.xs  view on Meta::CPAN

      code = my_xstat_cm_Init(my_afsmon_CM_Handler, numCM, CMSktArray, numCollIDs,
                              collIDP, buff2, output_filename, detailed, CACHEMAN,
                              CMnameList, cm_showFlags, cm_showDefault);

      if (code) {
        sprintf(buffer,"my_xstat_cm_Init() returned error. %s", buff2);
        BSETCODE(130, buffer);
        XSRETURN_UNDEF;
      }

    }  /* end of process fileserver entries */

  /* end from afsmon_execute() */

    SETCODE(0);

    EXTEND(SP, 2);
    PUSHs(sv_2mortal(newRV_inc((SV*)FILESERV)));
    PUSHs(sv_2mortal(newRV_inc((SV*)CACHEMAN)));
  }



( run in 0.396 second using v1.01-cache-2.11-cpan-8d75d55dd25 )