Closed 7imbrook closed 7 years ago
+1 for this, is it worth still supporting the old alert_email
variable for backwards compatibility?
@TalkingQuickly yeah, I'll add it back in. I think you should mark it as deprecated because having both is a bit too verbose. But for now we shouldn't break things for people who are depending on it. Totally missed that, thanks for pointing that out.
@7imbrook thank you very much for this! I think the easiest way to support multiple emails and still keep backwards compatibility would be to leave the alert_email
attribute as-is, and in the monitrcrb.erb
template, coerce the attribute with Array
to ensure it can be iterated:
<% Array(node["monit"]["alert_email"]).each do |email| %>
set alert ...
<% end %>
It would be great if you could also add a quick note to the README indicating that either a string or an array can be used for this attribute. Thanks!
Closing because I forgot what this was ever for. And it's old.
As discussed here using
set alert
multiple times will set multiple recipients. The changes I made reflect this with:alert_email
being changed to:alert_emails
and making it take an array of emails.