Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
default[:monit][:send_alerts] = true
default[:monit][:notify_email] = "notify@example.com"
default[:monit][:notify_email] = nil
default[:monit][:notify_emails] = []

default[:monit][:poll_period] = 60
default[:monit][:poll_start_delay] = 120
Expand Down
8 changes: 6 additions & 2 deletions templates/default/monitrc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ set logfile syslog facility log_daemon
with <%= @node[:monit][:mailserver][:with] %>
<% end %>


set mail-format {
from: <%= @node[:monit][:mail_format][:from] %>
subject: <%= @node[:monit][:mail_format][:subject] %>
message: <%= @node[:monit][:mail_format][:message] %>
}

set alert <%= @node[:monit][:notify_email] %> NOT ON { action, instance, pid, ppid }
<% if @node[:monit][:notify_email] %>
set alert <%= @node[:monit][:notify_email] %> NOT ON { action, instance, pid, ppid }
<% end %>

<% @node[:monit][:notify_emails].each do |email| %>
set alert <%= email %> NOT ON { action, instance, pid, ppid }
<% end %>
<% end %>

set eventqueue
Expand Down