91179e
From 725e37cd14866906ba28c970394b9f7a4cd97413 Mon Sep 17 00:00:00 2001
91179e
From: Blazej Kucman <blazej.kucman@intel.com>
91179e
Date: Mon, 19 Dec 2022 11:21:58 +0100
91179e
Subject: [PATCH 64/83] Update mdadm Monitor manual.
91179e
91179e
- describe monitor work modes,
91179e
- clarify the turning off condition,
91179e
- describe the mdmonitor.service as a prefered management way.
91179e
91179e
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
91179e
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
91179e
---
91179e
 mdadm.8.in | 71 ++++++++++++++++++++++++++++++++++++++----------------
91179e
 1 file changed, 50 insertions(+), 21 deletions(-)
91179e
91179e
diff --git a/mdadm.8.in b/mdadm.8.in
91179e
index 70c79d1e..64f71ed1 100644
91179e
--- a/mdadm.8.in
91179e
+++ b/mdadm.8.in
91179e
@@ -2548,13 +2548,33 @@ Usage:
91179e
 .I options... devices...
91179e
 
91179e
 .PP
91179e
-This usage causes
91179e
+Monitor option can work in two modes:
91179e
+.IP \(bu 4
91179e
+system wide mode, follow all md devices based on
91179e
+.B /proc/mdstat,
91179e
+.IP \(bu 4
91179e
+follow only specified MD devices in command line.
91179e
+.PP
91179e
+
91179e
+.B \-\-scan -
91179e
+indicates system wide mode. Option causes the
91179e
+.I monitor
91179e
+to track all md devices that appear in
91179e
+.B /proc/mdstat.
91179e
+If it is not set, then at least one
91179e
+.B device
91179e
+must be specified.
91179e
+
91179e
+Monitor usage causes
91179e
 .I mdadm
91179e
 to periodically poll a number of md arrays and to report on any events
91179e
 noticed.
91179e
-.I mdadm
91179e
-will never exit once it decides that there are arrays to be checked,
91179e
-so it should normally be run in the background.
91179e
+
91179e
+In both modes,
91179e
+.I monitor
91179e
+will work as long as there is an active array with redundancy and it is defined to follow (for
91179e
+.B \-\-scan
91179e
+every array is followed).
91179e
 
91179e
 As well as reporting events,
91179e
 .I mdadm
91179e
@@ -2565,15 +2585,6 @@ or
91179e
 .B domain
91179e
 and if the destination array has a failed drive but no spares.
91179e
 
91179e
-If any devices are listed on the command line,
91179e
-.I mdadm
91179e
-will only monitor those devices, otherwise, all arrays listed in the
91179e
-configuration file will be monitored.  Further, if
91179e
-.B \-\-scan
91179e
-is given, then any other md devices that appear in
91179e
-.B /proc/mdstat
91179e
-will also be monitored.
91179e
-
91179e
 The result of monitoring the arrays is the generation of events.
91179e
 These events are passed to a separate program (if specified) and may
91179e
 be mailed to a given E-mail address.
91179e
@@ -2586,16 +2597,34 @@ device if relevant (such as a component device that has failed).
91179e
 
91179e
 If
91179e
 .B \-\-scan
91179e
-is given, then a program or an E-mail address must be specified on the
91179e
-command line or in the config file.  If neither are available, then
91179e
+is given, then a
91179e
+.B program
91179e
+or an
91179e
+.B e-mail
91179e
+address must be specified on the
91179e
+command line or in the config file. If neither are available, then
91179e
 .I mdadm
91179e
 will not monitor anything.
91179e
-Without
91179e
-.B \-\-scan,
91179e
-.I mdadm
91179e
-will continue monitoring as long as something was found to monitor.  If
91179e
-no program or email is given, then each event is reported to
91179e
-.BR stdout .
91179e
+For devices given directly in command line, without
91179e
+.B program
91179e
+or
91179e
+.B email
91179e
+specified, each event is reported to
91179e
+.BR stdout.
91179e
+
91179e
+Note: For systems where
91179e
+.If mdadm monitor
91179e
+is configured via systemd,
91179e
+.B mdmonitor(mdmonitor.service)
91179e
+should be configured. The service is designed to be primary solution for array monitoring,
91179e
+it is configured to work in system wide mode.
91179e
+It is automatically started and stopped according to current state and types of MD arrays in system.
91179e
+The service may require additional configuration, like
91179e
+.B e-mail
91179e
+or
91179e
+.B delay.
91179e
+That should be done in
91179e
+.B mdadm.conf.
91179e
 
91179e
 The different events are:
91179e
 
91179e
-- 
91179e
2.38.1
91179e