Red Hat Bugzilla – Bug 883427
[RFE] logwatch support for mdadm devices
Last modified: 2015-10-12 09:47:28 EDT
Description of problem: It would be nice if logwatch could report on mdadm devices in addition to its other functionality
Version-Release number of selected component (if applicable):7.3.6-49.el6
How reproducible: always
Steps to Reproduce:
1. have mdadm devices
2. wish to know their status
3. have to ssh in to look
Actual results: no reporting
Expected results: some reporting
Created attachment 657581 [details]
patch to add support for mdadm
This patch adds support for mdadm
The patch is 4 years old and seems that it has never been accepted upstream. It looks pretty ok-ish to me (not the shell calls though).
A few years back the mdadm folks said to only use mdadm to query the status. Their current docs don't say that, so I'll whip something up in pure perl....
Will take a bit though.
Created attachment 659419 [details]
pure perl scrape of /proc/mdstat
This patch makes no system calls.
For this to work under selinux, logwatch will need read access to system_u:object_r:proc_mdstat_t in order to read /proc/mdstat
That patch didn't run right on one of my hosts over the weekend.
I'll have a fixed one once I get it sorted.
Created attachment 662605 [details]
Less error prone pure perl scrape of /proc/mdstat
This version runs fine on my systems. Selinux still needs to grant getattr and read access to /proc/mdstat but this patch wont error out if the access is denied.
FYI mdadm script has been recently added to the mainstream repository:
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.