From: bugwz Date: Thu, 29 Aug 2024 14:50:07 +0000 (+0800) Subject: mgr/dashboard: alerts module supports setting multiple email recipients X-Git-Tag: v20.0.0~1158^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e4f60eb438e4f62bb7289181776aa6d1b774fd64;p=ceph.git mgr/dashboard: alerts module supports setting multiple email recipients Signed-off-by: bugwz --- diff --git a/doc/mgr/alerts.rst b/doc/mgr/alerts.rst index 319d9d9278701..8428424a371a3 100644 --- a/doc/mgr/alerts.rst +++ b/doc/mgr/alerts.rst @@ -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 ** ceph config set mgr mgr/alerts/smtp_destination ** diff --git a/src/pybind/mgr/alerts/module.py b/src/pybind/mgr/alerts/module.py index f20f047162d01..50ec520d346e1 100644 --- a/src/pybind/mgr/alerts/module.py +++ b/src/pybind/mgr/alerts/module.py @@ -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 {