]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Arrange that SparesMissing events generate an email too.
authorNeil Brown <neilb@suse.de>
Mon, 15 May 2006 01:35:47 +0000 (01:35 +0000)
committerNeil Brown <neilb@suse.de>
Mon, 15 May 2006 01:35:47 +0000 (01:35 +0000)
Signed-off-by: Neil Brown <neilb@suse.de>
ChangeLog
Monitor.c
mdadm.8

index 2529fe13db918c0360a776bb7e86f2ba549a2bb2..64b760aa3130bacf002dd4786a527898f3dbccfe 100644 (file)
--- 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
index d52b418293e34212191322243653bdb25e734201..306c43cfe8e118f4a2d05776475dafe1467d5d17 100644 (file)
--- 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 9a108faab50c42b8b6849be6c9224348630fd2a4..e3052dcd967c5bbdc49342efa7da179fa44880e4 100644 (file)
--- 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.