Skip to content

Commit e4f60eb

Browse files
committed
mgr/dashboard: alerts module supports setting multiple email recipients
Signed-off-by: bugwz <[email protected]>
1 parent 711163a commit e4f60eb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/mgr/alerts.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ The *alerts* module is enabled with::
2323
Configuration
2424
-------------
2525

26-
To configure SMTP, all of the following config options must be set::
26+
To configure SMTP, all of the following config options must be set
27+
(When setting ``mgr/alerts/smtp_destination``, you can use commas to separate multiple)::
2728

2829
ceph config set mgr mgr/alerts/smtp_host *<smtp-server>*
2930
ceph config set mgr mgr/alerts/smtp_destination *<email-address-to-send-to>*

src/pybind/mgr/alerts/module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Alerts(MgrModule):
2828
Option(
2929
name='smtp_destination',
3030
default='',
31-
desc='Email address to send alerts to',
31+
desc='Email address to send alerts to, use commas to separate multiple',
3232
runtime=True),
3333
Option(
3434
name='smtp_port',
@@ -243,7 +243,7 @@ def _send_alert_smtp(self,
243243
server = smtplib.SMTP(self.smtp_host, self.smtp_port)
244244
if self.smtp_password:
245245
server.login(self.smtp_user, self.smtp_password)
246-
server.sendmail(self.smtp_sender, self.smtp_destination, message)
246+
server.sendmail(self.smtp_sender, self.smtp_destination.split(','), message)
247247
server.quit()
248248
except Exception as e:
249249
return {

0 commit comments

Comments
 (0)