From d1732eebaca58830d3c9e76a5c42a0622510a424 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 15 May 2006 01:35:47 +0000 Subject: [PATCH] Arrange that SparesMissing events generate an email too. Signed-off-by: Neil Brown --- ChangeLog | 2 ++ Monitor.c | 4 +++- mdadm.8 | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2529fe13..64b760aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ Changes Prior to this release - Support 'mailfrom' line in mdadm.conf so the From: line in alert emails can be explicitly set. + - Arrange that SparesMissing (which is similar in import to + DegradedArray) generates an Email. Changes Prior to 2.4.1 release - Honour --write-mostly when adding to an array without persistent diff --git a/Monitor.c b/Monitor.c index d52b4182..306c43cf 100644 --- a/Monitor.c +++ b/Monitor.c @@ -489,6 +489,7 @@ static void alert(char *event, char *dev, char *disc, char *mailaddr, char *mail if (mailaddr && (strncmp(event, "Fail", 4)==0 || strncmp(event, "Test", 4)==0 || + strncmp(event, "Spares", 6)==0 || strncmp(event, "Degrade", 7)==0)) { FILE *mp = popen(Sendmail, "w"); if (mp) { @@ -527,7 +528,8 @@ static void alert(char *event, char *dev, char *disc, char *mailaddr, char *mail priority = LOG_CRIT; /* Good to know about, but are not failures: */ else if (strncmp(event, "Rebuild", 7)==0 || - strncmp(event, "MoveSpare", 9)==0) + strncmp(event, "MoveSpare", 9)==0 || + strncmp(event, "Spares", 6) != 0) priority = LOG_WARNING; /* Everything else: */ else diff --git a/mdadm.8 b/mdadm.8 index 9a108faa..e3052dcd 100644 --- a/mdadm.8 +++ b/mdadm.8 @@ -1332,7 +1332,7 @@ detects that it has fewer that this number when it first sees the array, it will report a .B SparesMissing message. -(syslog priority: Info) +(syslog priority: Warning) .TP .B TestMessage @@ -1346,6 +1346,7 @@ Only .B Fail , .B FailSpare , .B DegradedArray , +.B SparesMissing , and .B TestMessage cause Email to be sent. All events cause the program to be run. -- 2.39.2