[Logwatch-Devel] scsi service patch for solaris

David Baldwin david.baldwin at anu.edu.au
Wed Sep 14 23:10:33 MST 2005


did it again - sent from wrong account :-(

I got over 3000 parity errors on a single tape drive, so logwatch scsi service 
report was a bit over the top... This patch tames that.

The unmatched entries are mostly boot config messages, but the 'scsi' service 
only tells part of the story - the rest is told variously by 'genuix', 'glm', 
'pcish', etc dependent on system hardware and which are excluded currently in 
scsi.conf

Also many error messages are multi-line and the continuations are also getting 
excluded.

Would require a lot of work to deal with all that - not really worth it...

sample report and 'diff -u' patch against latest CVS below.

David.

  --------------------- Kernel module scsi Begin ------------------------

  You have probably R/W errors on your disk or tape 3174 Time(s)
  WARNING: /pci at 8,700000/fibre-channel at 2/st at 4,0 (st18):: 1 time(s)
  WARNING: /pci at 8,700000/fibre-channel at 2/st at 5,0 (st19):: 1 time(s)
  WARNING: /pci at 8,700000/scsi at 3,1 (glm1):: 3172 time(s)

  **Unmatched Entries**
  ssd0 at fp0: name w21000004cffea02e,0, bus address e8
         <SUN36G cyl 24620 alt 2 hd 27 sec 107>
  ssd1 at fp0: name w21000004cffea067,0, bus address ef
         <SUN36G cyl 24620 alt 2 hd 27 sec 107>
  /pci at 8,700000/scsi at 3 (glm0):
  /pci at 8,700000/scsi at 3,1 (glm1):
         <STK-OPENstorageD280-0530 cyl 57342 alt 2 hd 256 sec 64>
         <STK-OPENstorageD280-0530 cyl 45054 alt 2 hd 512 sec 64>
         <STK-OPENstorageD280-0530 cyl 49150 alt 2 hd 256 sec 64>
         <STK-OPENstorageD280-0530 cyl 40958 alt 2 hd 512 sec 64>
         <STK-OPENstorageD280-0530 cyl 49150 alt 2 hd 256 sec 64>
         <STK-OPENstorageD280-0530 cyl 32766 alt 2 hd 512 sec 64>
         Vendor 'STK', product 'OPENstorage', 939524096 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         <STK-OPENstorageD280-0530 cyl 45411 alt 2 hd 128 sec 64>
         Vendor 'STK', product 'OPENstorage', 1476395008 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 805306368 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         <STK-OPENstorageD280-0540 cyl 32766 alt 2 hd 128 sec 64>
         <STK-OPENstorageD280-0540 cyl 32766 alt 2 hd 128 sec 64>
         <STK-UniversalXport-0530 cyl 8 alt 2 hd 64 sec 64>
         Vendor 'STK', product 'OPENstorage', 1342177280 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 805306368 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 1073741824 512 byte blocks
         <STK-OPENstorageD280-0530 cyl 32766 alt 2 hd 128 sec 64>
         Vendor 'STK', product 'OPENstorage', 372025344 512 byte blocks
         <STK-OPENstorageD280-0540 cyl 32766 alt 2 hd 128 sec 64>
         <STK-OPENstorageD280-0540 cyl 32766 alt 2 hd 128 sec 64>
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         <STK-UniversalXport-0530 cyl 8 alt 2 hd 64 sec 64>
         <STK-UniversalXport-0530 cyl 8 alt 2 hd 64 sec 64>
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         <STK-OPENstorageD280-0540 cyl 32766 alt 2 hd 128 sec 64>
         <STK-OPENstorageD280-0540 cyl 32766 alt 2 hd 128 sec 64>
         Vendor 'STK', product 'OPENstorage', 372025344 512 byte blocks
         <STK-OPENstorageD280-0530 cyl 32766 alt 2 hd 128 sec 64>
         Vendor 'STK', product 'OPENstorage', 1073741824 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 805306368 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 1342177280 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 805306368 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 1476395008 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 939524096 512 byte blocks
         <STK-UniversalXport-0530 cyl 8 alt 2 hd 64 sec 64>
         <STK-OPENstorageD280-0540 cyl 32766 alt 2 hd 128 sec 64>
         <STK-OPENstorageD280-0540 cyl 32766 alt 2 hd 128 sec 64>
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         <STK-OPENstorageD280-0530 cyl 45411 alt 2 hd 128 sec 64>
         Vendor 'STK', product 'OPENstorage', 268435456 512 byte blocks
         <STK-OPENstorageD280-0530 cyl 32766 alt 2 hd 512 sec 64>
         <STK-OPENstorageD280-0530 cyl 49150 alt 2 hd 256 sec 64>
         <STK-OPENstorageD280-0530 cyl 40958 alt 2 hd 512 sec 64>
         <STK-OPENstorageD280-0530 cyl 49150 alt 2 hd 256 sec 64>
         <STK-OPENstorageD280-0530 cyl 45054 alt 2 hd 512 sec 64>
         <STK-OPENstorageD280-0530 cyl 57342 alt 2 hd 256 sec 64>
  /pci at 8,700000/scsi at 3/st at 0,0 (st0):
  /pci at 8,700000/fibre-channel at 2/st at 0,0 (st14):
  /pci at 8,700000/fibre-channel at 2/st at 0,1 (st49):
  /pci at 8,700000/fibre-channel at 2/st at 0,2 (st50):
  /pci at 8,700000/fibre-channel at 2/st at 0,3 (st51):
  /pci at 8,700000/fibre-channel at 2/st at 1,0 (st15):
  /pci at 8,700000/fibre-channel at 2/st at 2,0 (st16):
  /pci at 8,700000/fibre-channel at 2/st at 3,0 (st17):
  /pci at 8,700000/fibre-channel at 2/st at 4,0 (st18):
  /pci at 8,700000/fibre-channel at 2/st at 5,0 (st19):
  /pci at 8,700000/scsi at 3/st at 2,0 (st2):
  /pci at 8,700000/scsi at 3,1/st at 1,0 (st8):
  /pci at 8,700000/scsi at 3,1/st at 3,0 (st10):
  /pci at 8,700000/scsi at 3,1/st at 4,0 (st11):
  /pci at 8,700000/scsi at 3/st at 0,0 (st0):
  /pci at 8,700000/fibre-channel at 2/st at 0,0 (st14):
  /pci at 8,700000/fibre-channel at 2/st at 0,1 (st49):
  /pci at 8,700000/fibre-channel at 2/st at 0,2 (st50):
  /pci at 8,700000/fibre-channel at 2/st at 0,3 (st51):
  /pci at 8,700000/fibre-channel at 2/st at 1,0 (st15):
  /pci at 8,700000/fibre-channel at 2/st at 2,0 (st16):
  /pci at 8,700000/fibre-channel at 2/st at 3,0 (st17):
  /pci at 8,700000/fibre-channel at 2/st at 4,0 (st18):
  /pci at 8,700000/fibre-channel at 2/st at 5,0 (st19):
  /pci at 8,700000/scsi at 3/st at 2,0 (st2):
  /pci at 8,700000/scsi at 3,1/st at 1,0 (st8):
  /pci at 8,700000/scsi at 3,1/st at 3,0 (st10):
  /pci at 8,700000/scsi at 3,1/st at 4,0 (st11):

  ---------------------- Kernel module scsi End -------------------------




--- scripts/services/scsi       21 May 2005 23:11:51 -0000      1.1
+++ scripts/services/scsi       15 Sep 2005 05:51:03 -0000
@@ -20,16 +20,21 @@
  #    etc, to logwatch-devel at logwatch.org
  ########################################################

+use strict;
  use Logwatch ':all';

  my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
+my $DebugCounter = 0;
+my $Diskwarning = 0;
+my %ListDiskWarning = ();
+my @OtherList = ();

  if ( $Debug >= 5 ) {
           print STDERR "\n\nDEBUG: Inside SCSI Filter \n\n";
           $DebugCounter = 1;
  }

-while (defined($ThisLine = <STDIN>)) {
+while (defined(my $ThisLine = <STDIN>)) {

      if ( $Debug >= 5 ) {
         print STDERR "DEBUG($DebugCounter): $ThisLine";
@@ -43,10 +48,10 @@
      } elsif ( ($ThisLine =~ m/WARNING:/) or
                ($ThisLine =~ m/Requested Block:/) or
                ($ThisLine =~ m/Sense Key:/) or
-             ($ThisLine =~ m/Vendor:/) or
+              ($ThisLine =~ m/Vendor:/) or
                ($ThisLine =~ m/ASC:/)
      ) {
-       push @ListDiskwarning, "$ThisLine\n";
+       $ListDiskWarning{$ThisLine} += 1;
         if ( $ThisLine =~ m/WARNING:/ )
         {
           $Diskwarning++;
@@ -60,8 +65,8 @@
  ###########################################################

  if ($Diskwarning) {
-    print "\nYou have probably R/W errors on your disk " . $Diskwarning . " 
Time(s)\n";
-    print @ListDiskwarning;
+    print "\nYou have probably R/W errors on your disk or tape $Diskwarning 
Time(s)\n";
+    print "$_: $ListDiskWarning{$_} time(s)\n" foreach keys %ListDiskWarning;
  }



-- 
=====================================================================+
David Baldwin                   mailto:David.Baldwin at anu.edu.au      |
Supercomputer Facility          URL: http://www.anu.edu.au/~u8611156 |
II Services, Huxley Building    Ph:  {intl+61+2 | (02)} 6125 0321    |
Australian National University  FAX: {intl+61+2 | (02)} 6125 8199    |
Canberra ACT 0200, AUSTRALIA  *======================================+


More information about the Logwatch-Devel mailing list