Fwd: patch to add reporting for "FAILURE PREDICTION THRESHOLD EXCEEDED" error

"Kirk Bauer" <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
------------------------------------------------------
Kirk Bauer <[email protected]>
http://linux.kaybee.org | www.logwatch.org
Author, Automating UNIX & Linux Administration


---------- Forwarded message ----------
From: Naveed Near-Ansari <[email protected]>
Date: Tue, Oct 14, 2008 at 3:18 PM
Subject: patch to add reporting for "FAILURE PREDICTION THRESHOLD EXCEEDED"
error
To: [email protected]



Was getting Failure predict errors so changed the smartd script to
account for it

_______________________________________________
Logwatch-Devel mailing list
[email protected]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
smartd.patch (text/x-patch, 1.3 KB)
--- smartd	2008-10-14 15:09:22.000000000 -0700
+++ /tmp/smartd	2008-10-14 15:04:51.000000000 -0700
@@ -46,7 +46,6 @@
 my %CantMonitor = ();
 my %SelfTest = ();
 my %Failed = ();
-my %FailPredicted = ();
 my @OtherList = ();
 my $DLine = 0;
 my %UnavailableDev = ();
@@ -135,8 +134,6 @@
       $SelfTest{$Device}{$TestType}++;
    } elsif ( my ($Device,$AttribType,$Code,$Name) = ($ThisLine =~ /^Device: ([^,]+), Failed SMART ([A-Za-z]+) Attribute: ([0-9]+) ([A-Za-z_]+)/)) {
       $Failed{$Device}{"$AttribType attribute: $Name ($Code)"}++;
-   } elsif ( my ($Device,$Name) = ($ThisLine =~ /^Device: ([^,]+), SMART Failure: FAILURE PREDICTION THRESHOLD EXCEEDED/)) {
-      $FailPredicted{$Device}{$Name}++;
    } elsif ( ( $ThisLine =~ /warning/i ) ) {
       $Warnings{$ThisLine}++;
    } elsif ( my ($Device, $Text) = ( $ThisLine =~ /^Device: ([^,]+), (can't monitor.*)$/i ) ) {
@@ -245,15 +242,6 @@
    }
 }
 
-if (keys %FailPredicted) {
-   foreach my $Device (sort keys %FailPredicted) {
-      print "\n$Device :\n";
-      foreach my $Msg (sort keys %{$FailPredicted{$Device}}) {
-         print "   Failure Predicted $Msg  " . $FailPredicted{$Device}{$Msg} . " Time(s)\n";
-      }
-   }
-}
-
 if (keys %SelfTest) {
    foreach my $Device (sort keys %SelfTest) {
       print "\n$Device :\n";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.