AFS-Monitor

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

system("cp ./pod/xstat_fs_test.pod lib/AFS/Monitor/xstat_fs_test.pod");


WriteMakefile(
              'NAME'       => 'AFS::Monitor',
              'VERSION'    => $VERSION,
              ($] >= 5.005 ?
                   ('AUTHOR'   => 'Alf Wachsmann, Elizabeth Cassell, and Steven Jenkins',
                    'ABSTRACT' => 'Perl interface to AFS monitoring and debugging APIs'
                   ) : () ),
              'realclean'  => {FILES => 'Makefile.bak pod/*.html pod/pod2htm* lib/AFS/*.pod lib/AFS/Monitor/*.pod examples/debug_out/debug examples/debug_out/outputfile lib'},
             );


sub MY::postamble {
	'
html: Makefile
	cd pod && $(MAKE) html

pod: blib
	cp pod/Monitor.pod       lib/AFS/Monitor.pod

examples/afsmonitor  view on Meta::CPAN


use blib;
use strict;
use AFS::Monitor;
use Data::Dumper;

my @cmhosts = ("www.openafs.org", "virtue.openafs.org", "andrew.e.kth.se");  # cache manager machines to monitor
my @fshosts = ("www.openafs.org", "virtue.openafs.org", "andrew.e.kth.se"); # file server machines to monitor
my $configfilename = 'configs/configfile';
my $badconfigfile  = 'configs/badconfig';
my $outputfilename = 'debug_out/outputfile';

my @tests;      # choose which tests to run
$tests[1] = 1;  # test of FS afsmonitor with detailed output file
$tests[2] = 2;  # test of CM afsmonitor
$tests[3] = 0;  # test of invalid file name
$tests[4] = 0;  # test of detailed flag without output flag
$tests[5] = 0;  # test of invalid FS host
$tests[6] = 0;  # test of invalid CM host
$tests[7] = 0;  # test of no flags
$tests[8] = 0;  # test of cmhosts and fshosts and config flags all at once

pod/Makefile  view on Meta::CPAN

	xstat_cm_test.html \
	xstat_fs_test.html

html:	$(P2H) $(HTML)

.SUFFIXES: .pm .pod

.SUFFIXES: .html

.pod.html:
	$(POD2HTML) --infile=$*.pod --outfile=$*.html

clean:
	rm -f $(HTML)
	rm -f pod2html-*cache
	rm -f pod2htmi.x* pod2htmd.x*

realclean:	clean
	rm -f $(CONVERTERS)

distclean:	realclean

pod/afsmonitor.pod  view on Meta::CPAN


  ($fs, $cm) = afsmonitor(cmhosts => "hostName1");

  ($fs, $cm) = afsmonitor(
                          cmhosts => ["hostName1", "hostName2"],
                          fshosts => ["hostName3", "hostName4"],
                         );

  ($fs, $cm) = afsmonitor(
                          config => "configfilename",
                          output => "outputfilename",
                          detailed => 1,
                         );

  foreach $host (@$fs) {
    print "FS Host: $host->{hostName}\n";
    if($host->{probeOK}) {
      print "probe successful\n";
    }
    else {
      print "probe failed\n";

src/Monitor.xs  view on Meta::CPAN

   my_Print_fs_DetailedPerfInfo(&(fullPerfP->det), fs_outFD);
}


/*
 * 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
my_afsmon_fsOutput(a_outfile, a_detOutput, xstat_fs_Results)
   char *a_outfile;             /* ptr to output file name */
   int a_detOutput;             /* detailed output ? */
   struct xstat_fs_ProbeResults xstat_fs_Results;
{

   char *printTime = 0;         /* ptr to time string */
   char *hostname = 0;          /* fileserner name */
   afs_int32 numLongs = 0;      /* longwords in result */
   afs_int32 *currLong = 0;     /* ptr to longwords in result */
   int i = 0;
   FILE *fs_outFD = 0;

   fs_outFD = fopen(a_outfile, "a");
   if (fs_outFD == (FILE *) NULL) {
      warn("failed to open output file %s", a_outfile);
      return;
   }

   /* get the probe time and strip the \n at the end */
   printTime = ctime((time_t *) & (xstat_fs_Results.probeTime));
   printTime[strlen(printTime) - 1] = '\0';
   hostname = xstat_fs_Results.connP->hostName;

   /* print "time hostname FS" */
   fprintf(fs_outFD, "\n%s %s FS ", printTime, hostname);

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.400 second using v1.00-cache-2.02-grep-82fe00e-cpan-f5108d614456 )