Great Circle Associates Majordomo-Users
(March 1997)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: list monitor
From: Bonnie Scott <bonnie @ staff . prodigy . com>
Date: Mon, 3 Mar 1997 16:34:34 -0500 (EST)
To: kenr @ troi . cc . rochester . edu (Ken Rich)
Cc: majordomo-users @ GreatCircle . COM
In-reply-to: <199702281130.GAA16224@troi.cc.rochester.edu> from "Ken Rich" at Feb 28, 97 06:30:13 am

> before i hack away does anyone have a quickie for monitoring lists
> traffic?  mostly i want to detect dead lists, but also to monitor
> some high-membership lists who have promised to be low-traffic.
> 
> --
> -ken rich             *generic_disclaimer*             kenr@cc.rochester.edu

Ken:

This is not the most gorgeous code I've written, but... here it is.  Hope
it's not too late.

It assumes a file, "listdata," that for me contains lists of lists "moderated,"
"unmoderated", "sensitive," "internal," (all mutually exclusive), and
"testing" (which incudes those lists that are :).  It prints out to STDOUT.

Bonnie Scott
Prodigy, Inc.


-------  inactive.pl  ------

#!/usr/local/bin/perl

push(@INC, "/majordomo/create");
require("listdata");

$archive_dir = "/majordomo/archive";

undef @intesting;

foreach $list (@test) {
   $intesting{$list} = "True";
   }

opendir(DIR, $archive_dir) || die ("Unable to open archive directory");
@files = readdir(DIR);

print "\n * Moderated Lists:\n";

foreach $listname (@moderated) {
  &checkitout;
  }

print "\n * Unmoderated Lists:\n";
foreach $listname (@unmoderated) {
  &checkitout;
  }

print "\n * Sensitive Lists:\n";

foreach $listname (@sensitive) {
  &checkitout;
  }

print "\n * Internal Lists:\n";

foreach $listname (@internal) {
  &checkitout;
  }

closedir(DIR);

######## Subfunction(s) #########

sub checkitout {
  print "$listname: ";
  if (!$intesting{$listname}) {
    @arcs = grep(/^$listname\./, @files);
    if (@arcs) {
      undef @months;
      foreach $month (sort @arcs) {
        $month =~ s/$listname\.96/96/;
        $month =~ s/$listname\.97/97/;
        $month =~ s/$listname\.98/98/;
        $month =~ s/$listname\.99/99/;
        $month =~ s/$listname\.00/00/;
     # if this script is still in use in 2001, that's OK.... the output will
     # just not be as compact
        push (@months, $month);
        }
      print ("Had activity during @months.");
      $l = pop(@months);
      @lastmod = stat("$archive_dir/$listname.$l");
# Figure out last modified time and make it human-readable
       ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdat)
               = localtime($lastmod[9]);
       $m = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon];
      $lastpost = ("$mday $m, $year at $hour:$min");
      print ("\n       Last post: $lastpost\n");
      } else {
      print ("Has not had ANY recent activity.\n");
      }
    } else {
      print ("is in testing.\n");
    }
  }







Follow-Ups:
Indexed By Date Previous: Majordomo 1.94.1 error
From: reg@sparc1.ge.adfa.oz.au (Reg Dwyer)
Next: Bounce Lists
From: SVEllis@mail.biosis.org
Indexed By Thread Previous: Majordomo 1.94.1 error
From: reg@sparc1.ge.adfa.oz.au (Reg Dwyer)
Next: newsgateway help
From: Gabriel Millerd <millerd@vhoorl.rli-net.net>

Google
 
Search Internet Search www.greatcircle.com