1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#!/usr/bin/perl -w
##########################################################################
# $Id: syslogd,v 1.8 2004/02/03 19:13:14 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.
########################################################
while (defined($ThisLine = <STDIN>)) {
chomp($ThisLine);
if ( $ThisLine =~ /^exiting on signal 15$/ ) {
#$Kills++;
}
elsif ($ThisLine =~ /^\s*restart[ .]*$/) {
$Starts++;
}
elsif ($ThisLine eq "restart") {
$Starts++;
}
elsif ($ThisLine =~ /^Cannot glue message parts together$/) {
$Errors++;
}
else {
# Report any unmatched entries...
chomp($ThisLine);
$OtherList{$ThisLine}++;
}
}
if ($Errors) {
print "\nCould not glue message parts together " . $Errors . " Time(s)\n";
}
if ($Starts) {
print "\nSyslogd started " . $Starts . " Time(s)\n";
}
if (keys %OtherList) {
print "\n**** Unmatched entries ****\n";
foreach $Error (keys %OtherList) {
print " $Error : $OtherList{$Error} Times\n";
}
}
exit(0);
# vi: shiftwidth=3 tabstop=3 et
|