Bug 640148 - mdadm --monitor does not
mdadm --monitor does not
Product: Fedora
Classification: Fedora
Component: mdadm (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Doug Ledford
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2010-10-04 21:23 EDT by John Levon
Modified: 2010-11-23 14:29 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-11-23 14:29:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Levon 2010-10-04 21:23:14 EDT
# cat /etc/mdadm.conf 
# mdadm.conf written out by anaconda
AUTO +imsm +1.x -all
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=3d6a48f2:d201f442:d6582c26:de55b491
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=3ca40f3a:5cac2743:ae9a0e8b:f01c2cc2
[root@pent etc]# mdadm --monitor  /dev/md0

<nothing appears>


# mdadm --detail --verbose /dev/md1 | grep Events ; sleep 10  ; mdadm --detail --verbose /dev/md1 | grep Events
         Events : 10283
         Events : 10287

[root@pent ~]# rpm -q mdadm
[root@pent ~]# rpm -q kernel
Comment 1 Doug Ledford 2010-11-23 13:16:32 EST
The MAILADDR line is commented out, and there is no PROGRAM line, so mdmonitor will not start.  You will need to uncomment the MAILADDR line in order for the service to work.
Comment 2 John Levon 2010-11-23 14:20:26 EST
To quote mdadm's man page:

"Without --scan, mdadm will continue monitoring as long as something was found to monitor.  If no program or email is given, then each event is reported to stdout."
Comment 3 Doug Ledford 2010-11-23 14:29:51 EST
Ah, I see.  You are running it from the command line to monitor output.  However, your own comments don't indicate if anything of interest occured (such as the array transitioning from active to degraded state).  The event count is not enough to know whether or not mdadm --monitor should output anything (in other words, when the man page says it reports each event, that's each event from the list of event types mdadm monitor cares about, not necessarily events that trigger an update to the event counter).  There are a list of events that monitor mode watches for, and it emits a message only on those events.  In addition, it emits messages on *transitions* from one state to another.  So, if an array is already degraded, then a new event that didn't transition the array from active to degraded will not trigger a degraded email.  In order to test and see if things are truly awry, you would need to start mdadm in monitor mode, and then transition an array from a good state to a degraded state, and in that case you should get an output on stdout.  Closing this back out, reopen if mdadm doesn't perform in the regard I mentioned.

Note You need to log in before you can comment on or make changes to this bug.