home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / MacPerl 5.0.3 / MacPerl Source ƒ / Perl5 / eg / scan / scan_messages < prev    next >
Encoding:
Text File  |  1994-12-26  |  5.0 KB  |  100 lines  |  [TEXT/MPS ]

  1.     }
  2.     elsif (/^n/) {
  3.     next if /^not found /;
  4.     }
  5.     elsif (/^p/) {
  6.     next if /^page map /;
  7.     next if /^pi[0-9] at /;
  8.     $pfx = '*' if /^panic/;
  9.     }
  10.     elsif (/^q/) {
  11.     next if /^qqq /;
  12.     }
  13.     elsif (/^r/) {
  14.     next if /^read  /;
  15.     next if /^revarp: Requesting/;
  16.     next if /^root [od]/;
  17.     }
  18.     elsif (/^s/) {
  19.     next if /^sc[0-9] at /;
  20.     next if /^sd[0-9] at /;
  21.     next if /^sd[0-9]: </;
  22.     next if /^si[0-9] at /;
  23.     next if /^si_getstatus/;
  24.     next if /^sk[0-9] at /;
  25.     next if /^skioctl/;
  26.     next if /^skopen/;
  27.     next if /^skprobe/;
  28.     next if /^skread/;
  29.     next if /^skwrite/;
  30.     next if /^sky[0-9] at /;
  31.     next if /^st[0-9] at /;
  32.     next if /^st0:.*load/;
  33.     next if /^stat1 = /;
  34.     next if /^syncing disks/;
  35.     next if /^syslogd: going down on signal 15/;
  36.     }
  37.     elsif (/^t/) {
  38.     next if /^timeout [0-9]/;
  39.     next if /^tm[0-9] at /;
  40.     next if /^tod[0-9] at /;
  41.     next if /^tv [0-9]/;
  42.     $pfx = '*' if /^trap address/;
  43.     }
  44.     elsif (/^u/) {
  45.     next if /^unit nsk/;
  46.     next if /^use one of/;
  47.     $pfx = '' if /^using/;
  48.     next if /^using [0-9]+ buffers/;
  49.     }
  50.     elsif (/^x/) {
  51.     next if /^xy[0-9] at /;
  52.     next if /^write [0-9]/;
  53.     next if /^xy[0-9]: </;
  54.     next if /^xyc[0-9] at /;
  55.     }
  56.     elsif (/^y/) {
  57.     next if /^yyy [0-9]/;
  58.     }
  59.     elsif (/^z/) {
  60.     next if /^zs[0-9] at /;
  61.     }
  62.     $pfx = '*' if /^[a-z]+:$/;
  63.     s/pid [0-9]+: //;
  64.     if (/last message repeated ([0-9]+) time/) {
  65.     $seen{$last} += $1;
  66.     next;
  67.     }
  68.     s/^/$pfx/ if $pfx;
  69.     unless ($seen{$_}++) {
  70.     push(@seen,$_);
  71.     }
  72.     $last = $_;
  73. }
  74. $max = tell(Msgs);
  75.  
  76. open(tmp,'|sort >oldmsgs.tmp') || die "Can't create tmp file: $!\n";
  77. while ($_ = pop(@seen)) {
  78.     print tmp $_;
  79. }
  80. close(tmp);
  81. open(tmp,'oldmsgs.tmp') || die "Can't reopen tmp file: $!\n";
  82. while (<tmp>) {
  83.     if (/^nd:/) {
  84.     next if $seen{$_} < 20;
  85.     }
  86.     if (/NFS/) {
  87.     next if $seen{$_} < 20;
  88.     }
  89.     if (/no carrier/) {
  90.     next if $seen{$_} < 20;
  91.     }
  92.     if (/silo overflow/) {
  93.     next if $seen{$_} < 20;
  94.     }
  95.     print $seen{$_},":\t",$_;
  96. }
  97.  
  98. print `rm -f oldmsgs.tmp 2>&1; echo $max > oldmsgs 2>&1`;
  99.