Revision: 204
http://sourceforge.net/p/logwatch/code/204
Author: opoplawski
Date: 2014-09-08 15:49:35 +0000 (Mon, 08 Sep 2014)
Log Message:
-----------
[smartd] Add montoring list detail; handle new log lines
Modified Paths:
--------------
scripts/services/smartd
Modified: scripts/services/smartd
===================================================================
--- scripts/services/smartd 2014-07-18 18:04:48 UTC (rev 203)
+++ scripts/services/smartd 2014-09-08 15:49:35 UTC (rev 204)
@@ -61,6 +61,8 @@
my %UnavailableDev = ();
my %SataDisk = ();
my %CheckFailed = ();
+my %Monitoring = ();
+my %DeviceInfo = ();
my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
my $IgnoreUnmatched = $ENV{'smartd_ignore_unmatched'} || 0;
@@ -69,7 +71,7 @@
chomp($ThisLine);
if ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), No such device(?: or address)?, open\(\) failed/ )) {
# ignore
- } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), is SMART capable. Adding to "monitor" list./ )) {
+ } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), open\(\) failed: No such device(?: or address)?/ )) {
# ignore
} elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), found in smartd database./ )) {
# ignore
@@ -116,8 +118,9 @@
} elsif ( ($Device,$Msg) = ($ThisLine =~ /^ *$/ )) {
# ignore empty lines
} elsif ( ($ThisLine =~ /^smartd version/)
+ || ($ThisLine =~ /^smartd [0-9.]+ [0-9-]+ r[0-9]+ \[.*\]/)
|| ($ThisLine =~ /^Home page/)
- || ($ThisLine =~ /^smartd .*Copyright \(C\) [0-9-]+ by Bruce Allen/)
+ || ($ThisLine =~ /Copyright \(C\) [0-9-]+ by Bruce Allen/)
|| ($ThisLine =~ /configuration file/i)
|| ($ThisLine =~ /\[trip Temperature is \d+ Celsius\]/)
|| ($ThisLine =~ /^Monitoring/)
@@ -135,6 +138,10 @@
{
# ignore
+ } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), is SMART capable. Adding to "monitor" list./ )) {
+ $Monitoring{$Device} = 1;
+ } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), ([^,]+, S\/N:[^,]+, WWN:[^,]+, FW:.*)/ )) {
+ $DeviceInfo{$Device} = $Msg;
# } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), (.*)$/)) {
# $ParamChanges{$Device}{$Msg}++;
} elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), not found in smartd database./ )) {
@@ -360,6 +367,18 @@
print "\n";
}
+if (keys %Monitoring and $Detail > 7) {
+ print "\nMonitoring:\n";
+ foreach my $Device (sort keys %Monitoring) {
+ print "\t$Device";
+ if (defined($DeviceInfo{$Device})) {
+ print ": $DeviceInfo{$Device}\n";
+ } else {
+ print "\n";
+ }
+ }
+}
+
if ((%OtherList) and (not $IgnoreUnmatched)){
print "\n**Unmatched Entries**\n";
foreach my $line (sort keys %OtherList) {
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
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.