SF.net SVN: logwatch:[239] scripts/services/smartd

[email protected] Tue, 16 Sep 2014 20:14:13 +0000
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Revision: 239
          http://sourceforge.net/p/logwatch/code/239
Author:   opoplawski
Date:     2014-09-16 20:14:12 +0000 (Tue, 16 Sep 2014)
Log Message:
-----------
[smartd] Fix some regexps, device info lines, error with CantMonitor report

Modified Paths:
--------------
    scripts/services/smartd

Modified: scripts/services/smartd
===================================================================
--- scripts/services/smartd	2014-09-16 08:00:55 UTC (rev 238)
+++ scripts/services/smartd	2014-09-16 20:14:12 UTC (rev 239)
@@ -84,7 +84,7 @@
        # ignore
    } elsif ( ($Device,$Msg) = ($ThisLine =~ /^# *[0-9]+  Offline *Fatal or unknown error/ )) {
        # ignore
-   } elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), not capable of SMART self-check/ )) {
+   } elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), not capable of SMART (Health Status |self-)check/ )) {
        # ignore
    } elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), is in STANDBY mode, skipping checks/ )) {
        # ignore
@@ -113,7 +113,8 @@
       || ($ThisLine =~ /smartd (startup|shutdown) succeeded/)
       || ($ThisLine =~ /Unable to register device (.*) \(no Directive -d removable\). Exiting/)
       || ($ThisLine =~ /Device (.*), SATA disks accessed via libata are not currently supported by smartmontools./)
-      || ($ThisLine =~ /Device: (.*), IE \(SMART\) not enabled, skip device Try '.*' to turn on SMART features/)
+      || ($ThisLine =~ /Device: (.*), IE \(SMART\) not enabled, skip device/)
+      || ($ThisLine =~ /^Try '.*' to turn on SMART features/)
       || ($ThisLine =~ /Device: (.*), Bad IEC (SMART) mode page, err=-5, skip device/)
       || ($ThisLine =~ /Drive: DEVICESCAN, implied '-a' Directive on line [\d]+ of file/)
       || ($ThisLine =~ /packet devices \[this device CD\/DVD\] not SMART capable/)
@@ -123,8 +124,10 @@
 
    } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), is SMART capable. Adding to "monitor" list./ )) {
       $Monitoring{$Device} = 1;
-   } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), ([^,]+, S\/N:[^,]+, WWN:[^,]+, FW:.*)/ )) {
+   } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), ([^,]+, S\/N:[^,]+,.* FW:.*)/ )) {
       $DeviceInfo{$Device} = $Msg;
+   } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), (\[[^,]+, lu id: .*)/ )) {
+      $DeviceInfo{$Device} = $Msg;
 #   } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), (.*)$/)) {
 #      $ParamChanges{$Device}{$Msg}++;
    } elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), not found in smartd database./ )) {
@@ -206,7 +209,7 @@
 }
 
 if (keys %CantMonitor) {
-   foreach my $Device (sort keys %ParamChanges) {
+   foreach my $Device (sort keys %CantMonitor) {
       print "\n$Device :\n";
       foreach my $Line (sort keys %{$CantMonitor{$Device}}) {
          print "  $Line - " . $CantMonitor{$Device}{$Line} . " Time(s)\n";

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk