Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 657581 Details for
Bug 883427
[RFE] logwatch support for mdadm devices
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to add support for mdadm
logwatch_mdadm.diff (text/plain), 3.96 KB, created by
jcpunk
on 2012-12-04 15:13:12 UTC
(
hide
)
Description:
patch to add support for mdadm
Filename:
MIME Type:
Creator:
jcpunk
Created:
2012-12-04 15:13:12 UTC
Size:
3.96 KB
patch
obsolete
>--- scripts/services/mdadm 2008-03-31 12:52:59.000000000 -0500 >+++ scripts/services/mdadm 2008-03-31 12:36:49.000000000 -0500 >@@ -0,0 +1,105 @@ >+#!/usr/bin/perl -w >+use strict; >+$|++; >+ >+my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0; >+ >+my $devices = `mdadm --examine --scan 2>/dev/null| awk '{print \$2}'`; >+ >+chomp($devices); >+ >+if ($devices ne '') >+ { >+ foreach my $dev (split(/\n/,$devices)) >+ { >+ my $md = `mdadm --misc --detail $dev | grep -v $dev`; >+ chomp($md); >+ >+ my %mdhash; >+ foreach (split(/\n/,$md)) >+ { >+ $mdhash{'level'} = $1 if ($_ =~ /Raid Level ?: ?(.*)$/); >+ $mdhash{'active'} = $1 if ($_ =~ /Active Devices ?: ?(.*)$/); >+ $mdhash{'working'} = $1 if ($_ =~ /Working Devices ?: ?(.*)$/); >+ $mdhash{'failed'} = $1 if ($_ =~ /Failed Devices ?: ?(.*)$/); >+ $mdhash{'spare'} = $1 if ($_ =~ /Spare Devices ?: ?(.*)$/); >+ $mdhash{'state'} = $1 if ($_ =~ /State ?: ?(.*)$/); >+ $mdhash{'rebuild'} = $1 if ($_ =~ /Rebuild Status ?: ?(.*)$/); >+ push(@{$mdhash{'good devices'}},$1) if ($_ =~ /sync .*(\/dev\/[\w\d\-\_]*)/); >+ push(@{$mdhash{'middle devices'}},$1) if ($_ =~ /rebuilding .*(\/dev\/[\w\d\-\_]*)/); >+ push(@{$mdhash{'bad devices'}},$1) if ($_ =~ /faulty .*(\/dev\/[\w\d\-\_]*)/); >+ } >+ >+ if ($Detail <= 4) >+ { >+ if (lc($mdhash{'state'}) =~ /clean|active/) >+ { >+ print "$dev : $mdhash{'state'}\n"; >+ } >+ else >+ { >+ print "$dev : $mdhash{'state'}\n"; >+ if (@{$mdhash{'middle devices'}}) >+ { >+ if (defined($mdhash{'rebuild'}) and ($mdhash{'rebuild'} ne '')) >+ { >+ print "\tRebuilding status: $mdhash{'rebuild'}\n"; >+ } >+ print "\tRebuilding @{$mdhash{'middle devices'}}\n"; >+ } >+ if (@{$mdhash{'bad devices'}}) >+ { >+ print "\tFailed @{$mdhash{'bad devices'}}\n"; >+ } >+ } >+ } >+ elsif($Detail <= 9) >+ { >+ if (lc($mdhash{'state'}) =~ /clean|active/) >+ { >+ print "$dev : $mdhash{'state'} - @{$mdhash{'good devices'}}\n"; >+ } >+ else >+ { >+ print "$dev : $mdhash{'state'}\n"; >+ if (@{$mdhash{'middle devices'}}) >+ { >+ if (defined($mdhash{'rebuild'}) and ($mdhash{'rebuild'} ne '')) >+ { >+ print "\tRebuilding status: $mdhash{'rebuild'}\n"; >+ } >+ print "\t Rebuilding : @{$mdhash{'middle devices'}}\n"; >+ } >+ if (@{$mdhash{'bad devices'}}) >+ { >+ print "\t Failed : @{$mdhash{'bad devices'}}\n"; >+ } >+ print "\t Good : @{$mdhash{'good devices'}}\n"; >+ } >+ } >+ else >+ { >+ print "$dev : $mdhash{'state'}\n"; >+ print "\t Raid Level : $mdhash{'level'}\n"; >+ print "\tGood Devices : @{$mdhash{'good devices'}}\n"; >+ if (defined ($mdhash{'middle devices'}) and @{$mdhash{'middle devices'}}) >+ { >+ if (defined($mdhash{'rebuild'}) and ($mdhash{'rebuild'} ne '')) >+ { >+ print "\tRebuilding status: $mdhash{'rebuild'}\n"; >+ } >+ print "\t Rebuilding : @{$mdhash{'middle devices'}}\n"; >+ } >+ if (defined($mdhash{'bad devices'}) and @{$mdhash{'bad devices'}}) >+ { >+ print "\t Failed : @{$mdhash{'bad devices'}}\n"; >+ } >+ if ($mdhash{'spare'} ne 0) >+ { >+ print "\t Spares : $mdhash{'spare'}\n"; >+ } >+ print "\n"; >+ } >+ } >+ } >+ >--- conf/services/mdadm.conf 2008-03-31 12:52:59.000000000 -0500 >+++ conf/services/mdadm.conf 2008-03-31 12:49:09.000000000 -0500 >@@ -0,0 +1,15 @@ >+# You can put comments anywhere you want to. They are effective for the >+# rest of the line. >+ >+# this is in the format of <name> = <value>. Whitespace at the beginning >+# and end of the lines is removed. Whitespace before and after the = sign >+# is removed. Everything is case *insensitive*. >+ >+# Yes = True = On = 1 >+# No = False = Off = 0 >+ >+Title = "Mdadm" >+ >+# Which logfile group... >+LogFile = messages >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 883427
:
657581
|
659419
|
662605