#!/usr/bin/perl -w
##########################################################################
# $Id: modprobe,v 1.6 2002/10/12 02:08:18 kirk Exp $
##########################################################################

########################################################
# This was written and is maintained by:
#    Kirk Bauer <kirk@kaybee.org>
#
# Please send all comments, suggestions, bug reports,
#    etc, to kirk@kaybee.org.
########################################################

#$Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'};

while (defined($ThisLine = <STDIN>)) {
   chomp($ThisLine);
   if ( $ThisLine =~ s/^modprobe: Can\'t locate module ([\w-]+)\s*$/$1/ ) {
      $Modules{$ThisLine}++;
   }
   else {
      $OtherList{$ThisLine}++;
   }
}

if (keys %Modules) {
   print "\nCan't locate these modules:\n";
   foreach my $ThisOne (keys %Modules) {
      print "   " . $ThisOne . ": " . $Modules{$ThisOne} . " Time(s)\n";
   }
}

if (keys %OtherList) {
   print "\n**Unmatched Entries**\n";
   foreach $line (sort {$a cmp $b} keys %OtherList) {
      print "$line: $OtherList{$line} Time(s)\n";
   }
}

exit(0);

