]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: alerts module supports setting multiple email recipients 59512/head
authorbugwz <xbugwz@gmail.com>
Thu, 29 Aug 2024 14:50:07 +0000 (22:50 +0800)
committerbugwz <xbugwz@gmail.com>
Thu, 29 Aug 2024 14:50:07 +0000 (22:50 +0800)
Signed-off-by: bugwz <xbugwz@gmail.com>
doc/mgr/alerts.rst
src/pybind/mgr/alerts/module.py

index 319d9d92787019cb37120fca088b930e418e4612..8428424a371a34225653d63939f2fc4efda9fa93 100644 (file)
@@ -23,7 +23,8 @@ The *alerts* module is enabled with::
 Configuration
 -------------
 
-To configure SMTP, all of the following config options must be set::
+To configure SMTP, all of the following config options must be set
+(When setting ``mgr/alerts/smtp_destination``, you can use commas to separate multiple)::
 
   ceph config set mgr mgr/alerts/smtp_host *<smtp-server>*
   ceph config set mgr mgr/alerts/smtp_destination *<email-address-to-send-to>*
index f20f047162d01730a77037fab41700d9f1b50109..50ec520d346e14a40198efacde9f00598537fbff 100644 (file)
@@ -28,7 +28,7 @@ class Alerts(MgrModule):
         Option(
             name='smtp_destination',
             default='',
-            desc='Email address to send alerts to',
+            desc='Email address to send alerts to, use commas to separate multiple',
             runtime=True),
         Option(
             name='smtp_port',
@@ -243,7 +243,7 @@ class Alerts(MgrModule):
                 server = smtplib.SMTP(self.smtp_host, self.smtp_port)
             if self.smtp_password:
                 server.login(self.smtp_user, self.smtp_password)
-            server.sendmail(self.smtp_sender, self.smtp_destination, message)
+            server.sendmail(self.smtp_sender, self.smtp_destination.split(','), message)
             server.quit()
         except Exception as e:
             return {