Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Commit

Permalink
Add mail_alerts attribute
Browse files Browse the repository at this point in the history
Allows mail alerts to be disabled in the monitrc template.
  • Loading branch information
fixlr committed Apr 8, 2013
1 parent 4bb273b commit 5ef384a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -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"

Expand Down
3 changes: 3 additions & 0 deletions attributes/default.rb
Expand Up @@ -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"

Expand Down
3 changes: 3 additions & 0 deletions templates/default/monitrc.erb
Expand Up @@ -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"] %>"
Expand Down

0 comments on commit 5ef384a

Please sign in to comment.