logwatch-devel

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [Logwatch-Devel] smartd script patch Mike Tremaine Tue Jun 02 09:00:19 2009

Ivana Varekova wrote:
I'm going through fedora logwatch patches and this one is not in upstream branch so I'm sending it here.

Ivana Hutarova Varekova

------------------------------------------------------------------------

_______________________________________________
Logwatch-Devel mailing list
[EMAIL PROTECTED]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
Committed to CVS,,, Offset difference as noted

patching file smartd
Hunk #1 succeeded at 38 (offset 30 lines).
Hunk #2 succeeded at 131 with fuzz 1 (offset 35 lines).
Hunk #3 succeeded at 223 (offset 37 lines).
[EMAIL PROTECTED] services]$ cvs diff smartd
Index: smartd
===================================================================
RCS file: /var/cvs/logwatch/scripts/services/smartd,v
retrieving revision 1.25
diff -r1.25 smartd
40a41,42
> my %TempLimit = ();
> my %TempCritLimit = ();
132c134,140
< } 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/)) {
218c226
<        if($Detail < 10) {
---
>    if($Detail < 10) {
224c232,248
<        }
---
>    }
> }
>
> 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";
>    }
225a250
> _______________________________________________
Logwatch-Devel mailing list
[EMAIL PROTECTED]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel