rpms/logwatch/F-10 logwatch-7.3.6-smartd.patch, NONE, 1.1 logwatch.spec, 1.105, 1.106
Ivana Varekova
varekova at fedoraproject.org
Mon Jul 13 07:36:55 UTC 2009
Author: varekova
Update of /cvs/pkgs/rpms/logwatch/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24929
Modified Files:
logwatch.spec
Added Files:
logwatch-7.3.6-smartd.patch
Log Message:
- fix smartd script (#477540)
logwatch-7.3.6-smartd.patch:
--- NEW FILE logwatch-7.3.6-smartd.patch ---
diff -up logwatch-7.3.6/scripts/services/smartd.pom logwatch-7.3.6/scripts/services/smartd
--- logwatch-7.3.6/scripts/services/smartd.pom 2007-04-09 16:46:46.000000000 +0200
+++ logwatch-7.3.6/scripts/services/smartd 2009-01-06 13:45:00.000000000 +0100
@@ -8,6 +8,8 @@ use strict;
my ($Device, $Msg, $Test);
my %ParamChanges = ();
my %TempChanges = ();
+my %TempLimit = ();
+my %TempCritLimit = ();
my %Pendsectors = ();
my %NumPendsectors = ();
my %Offsectors = ();
@@ -94,7 +96,13 @@ while (defined(my $ThisLine = <STDIN>))
# smartd reports temperature changes this way only for SCSI disks
} elsif ( my ($Device,$NewVal) = ($ThisLine =~ /^Device: ([^,]+), initial Temperature is (\d+) Celsius/)) {
push @{$TempChanges{$Device}},$NewVal;
- } elsif ( my ($Device,$NewVal) = ($ThisLine =~ /^Device: ([^,]+), Temperature changed -?\d+ Celsius to (\d+) Celsius/)) {
+ } elsif ( my ($Device,$Limit) = ($ThisLine =~ /^Device: ([^,]+), Temperature \d+ Celsius reached limit of (\d+) Celsius/)) {
+ # Device: /dev/sda, Temperature 37 Celsius reached limit of 10 Celsius (Min/Max 37/37)
+ $TempLimit{"$Device,$Limit"}++;
+ } elsif ( my ($Device,$Limit) = ($ThisLine =~ /^Device: ([^,]+), Temperature \d+ Celsius reached critical limit of (\d+) Celsius/)) {
+ # Device: /dev/sda, Temperature 38 Celsius reached critical limit of 15 Celsius (Min/Max 38!/39)
+ $TempCritLimit{"$Device,$Limit"}++;
+ } elsif ( my ($Device,$NewVal) = ($ThisLine =~ /^Device: ([^,]+), Temperature changed [-+]?\d+ Celsius to (\d+) Celsius/)) {
push @{$TempChanges{$Device}},$NewVal;
} elsif ( my ($Device, $Num) = ($ThisLine =~ /^Device: ([^,]+), (\d+) Currently unreadable \(pending\) sectors/) ) {
$Pendsectors{$Device}++;
@@ -178,14 +186,31 @@ if (keys %TempChanges) {
print "\n";
}
}
- if($Detail < 10) {
+ if($Detail < 10) {
my @sorttemp = sort @min;
my $mint = $sorttemp[0];
my @sorttemp = sort @max;
my $maxt = $sorttemp[$#sorttemp];
print "All devices: $mint - $maxt\n";
- }
+ }
+}
+
+if (keys %TempCritLimit) {
+ printf "\nReached critical temperature limit:\n";
+ foreach (keys %TempCritLimit) {
+ my ($Device,$Limit)=split ",";
+ print "\t" . $Device . ": reached limit of " . $Limit . " Celsius: ". $TempCritLimit{"$Device,$Limit"} . " Time(s)\n";
+ }
+}
+
+if (keys %TempLimit) {
+ printf "\nReached temperature limit:\n";
+ foreach (keys %TempLimit) {
+ my ($Device,$Limit)=split ",";
+ print "\t" . $Device . ": reached limit of " . $Limit . " Celsius: ". $TempLimit{"$Device,$Limit"} . " Time(s)\n";
+ }
}
+
if (keys %Pendsectors){
print "\nCurrently unreadable (pending) sectors detected:\n";
Index: logwatch.spec
===================================================================
RCS file: /cvs/pkgs/rpms/logwatch/F-10/logwatch.spec,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -p -r1.105 -r1.106
--- logwatch.spec 15 Jun 2009 09:23:39 -0000 1.105
+++ logwatch.spec 13 Jul 2009 07:36:54 -0000 1.106
@@ -1,7 +1,7 @@
Summary: A log file analysis program
Name: logwatch
Version: 7.3.6
-Release: 36%{?dist}
+Release: 37%{?dist}
License: MIT
Group: Applications/System
URL: http://www.logwatch.org/
@@ -52,6 +52,7 @@ Patch48: logwatch-7.3.6-named4.patch
Patch49: logwatch-7.3.6-openvpn3.patch
Patch50: logwatch-7.3.6-zz-disk_space2.patch
Patch51: logwatch-7.3.6-removeservice.patch
+Patch52: logwatch-7.3.6-smartd.patch
Requires: textutils sh-utils grep mailx
Requires: perl(Date::Manip)
@@ -112,6 +113,7 @@ of the package on many systems.
%patch49 -p1
%patch50 -p1
%patch51 -p1
+%patch52 -p1
rm -f scripts/services/*.orig
%build
@@ -223,6 +225,9 @@ rm -rf %{buildroot}
%doc License project/CHANGES
%changelog
+* Mon Jul 13 2009 Ivana Varekova <varekova at redhat.com> 7.3.6-37
+- fix smartd script (#477540)
+
* Mon Jun 15 2009 Ivana Varekova <varekova at redhat.com> 7.3.6-36
- fix removeservice script - to decrease the number of
perl instances running simultaneously
More information about the fedora-extras-commits
mailing list