Skip to content

Commit

Permalink
Merge pull request rcbops-cookbooks#43 from NCTU-NBA/moln
Browse files Browse the repository at this point in the history
Add M/Monit support
  • Loading branch information
claco committed Jun 25, 2014
2 parents 417c75f + 2b0c0da commit bb9bbb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@
Yours sincerely,
monit
EOS

default["monit"]["mmonit"]["host"] = nil
default["monit"]["mmonit"]["urlscheme"] = "http"
default["monit"]["mmonit"]["user"] = "monit"
default["monit"]["mmonit"]["password"] = "monit"
default["monit"]["mmonit"]["port"] = 8080
6 changes: 6 additions & 0 deletions templates/default/monitrc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,18 @@ set alert <%= @node[:monit][:notify_email] %> NOT ON { action, instance, pid, pp
# allow @monit # allow users of group 'monit' to connect (rw)
# allow @users readonly # allow users of group 'users' to connect readonly
#
<% if @node[:monit][:mmonit][:host] %>
set mmonit <%= node["monit"]["mmonit"]["urlscheme"] %>://<%= node["monit"]["mmonit"]["user"] %>:<%= node["monit"]["mmonit"]["password"] %>@<%= node["monit"]["mmonit"]["host"] %>:<%= node["monit"]["mmonit"]["port"] %>/collector
<% end %>
<% if @node[:monit][:httpd_enabled] %>
set httpd port <%= @bind_port %> and use the address <%= @bind_host %>
allow <%= @login_user %>:<%= @login_pass %>
<% for host in @allowed_hosts %>
allow <%= host %>
<% end %>
<% if @node[:monit][:mmonit][:host] %>
allow <%= node["monit"]["mmonit"]["host"] %>
<% end %>
<% end %>

###############################################################################
Expand Down

0 comments on commit bb9bbb7

Please sign in to comment.