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