Permalink
Browse files

Add mail_alerts attribute

Allows mail alerts to be disabled in the monitrc template.
  • Loading branch information...
1 parent 4bb273b commit 5ef384a94e0cfb784396a8d0390a619692c6faf3 @fixlr fixlr committed Mar 22, 2013
Showing with 9 additions and 0 deletions.
  1. +3 −0 README.md
  2. +3 −0 attributes/default.rb
  3. +3 −0 templates/default/monitrc.erb
View
@@ -60,6 +60,9 @@ default["monit"]["use_syslog"] = true
# If not using syslog, the log file that monit will use.
default["monit"]["logfile"] = "/var/log/monit.log"
+# Enable emails for internal monit alerts
+default["monit"]["mail_alerts"] = true
+
# Email address that will be notified of events.
default["monit"]["alert_email"] = "root@localhost"
View
@@ -17,6 +17,9 @@
# If not using syslog, the log file that monit will use.
default["monit"]["logfile"] = "/var/log/monit.log"
+# Enable emails for internal monit alerts
+default["monit"]["mail_alerts"] = true
+
# Email address that will be notified of events.
default["monit"]["alert_email"] = "root@localhost"
@@ -8,8 +8,11 @@ set logfile syslog facility log_daemon
set logfile <%= node["monit"]["logfile"] %>
<% end %>
+<% if node['monit']['mail_alerts'] %>
# Mail alerts
set alert <%= node["monit"]["alert_email"] %>
+<% end %>
+
set mailserver <%= node["monit"]["mail"]["hostname"] %> port <%= node["monit"]["mail"]["port"] %>
<% if node["monit"]["mail"]["username"] -%>
username "<%= node["monit"]["mail"]["username"] %>"

0 comments on commit 5ef384a

Please sign in to comment.