cookbook 'monit_wrapper', '~> 3.4.0', :supermarket
monit_wrapper
(31) Versions
3.4.0
-
Follow0
A wrapper around Monit making it easier to monitor services
cookbook 'monit_wrapper', '~> 3.4.0'
knife cookbook site install monit_wrapper
knife cookbook site download monit_wrapper
monit_wrapper
This cookbook simplifies setting up services using Monit.
- GitHub: https://github.com/clearstorydata-cookbooks/monit_wrapper
- Chef Supermarket: https://supermarket.chef.io/cookbooks/monit_wrapper
- Travis CI: https://travis-ci.org/clearstorydata-cookbooks/monit_wrapper
- Documentation: http://clearstorydata-cookbooks.github.io/monit_wrapper/chef/monit_wrapper.html
Examples
Custom Monit configuration template
Create a configuration template in your cookbook my_cookbook/templates/default/monit/my_service.conf.erb
:
check process <%= @service_name %>
matching '<%= @cmd_line_pattern %>'
every 1 cycles
start program "/bin/bash -c 'exec <%= @cmd_line %>'"
as uid <%= @user %> as gid <%= @user %>
stop program "/usr/bin/pkill -u <%= @user %> -f '<%= @cmd_line_pattern %>'"
as uid <%= @user %> as gid <%= @user %>
In my_cookbook/recipes/default.rb
:
my_service_name = '...'
command_line = '/usr/local/bin/my_service_executable --port 3456'
monit_wrapper_monitor my_service_name do
template_cookbook 'my_cookbook'
template_source 'monit/my_service.conf.erb'
variables cmd_line: command_line,
cmd_line_pattern: command_line,
user: user
end
monit_wrapper_notify_if_not_running monit_service_name
monit_wrapper_service my_service_name do
subscribes :restart, "monit_wrapper_monitor[#{my_service_name}]", :delayed
subscribes :restart, "monit_wrapper_notify_if_not_running[#{my_service_name}]", :delayed
subscribes :restart, "package[#{my_service_name}]", :delayed
end
Launching and monitoring a process with an existing init
If you have a service with an existing /etc/init.d
script, you can use this cookbook to create
a Monit configuration file to monitor that service. This makes use of the default Monit
configuration template
this cookbook provides.
my_sevice_name = 'my-service'
monit_wrapper_monitor my_service_name do
action :create
pattern '...'
end
monit_wrapper_notify_if_not_running my_service_name do
monit_wrapper_service service_name do
subscribes :restart, "package[#{service_name}]", :delayed
subscribes :restart, "monit_wrapper_monitor[#{service_name}]", :delayed
subscribes :restart, "monit_wrapper_notify_if_not_running[#{service_name}]",
:delayed
end
License
Apache License 2.0
Collaborator Number Metric
3.4.0 failed this metric
Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
3.4.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
3.4.0 passed this metric
License Metric
3.4.0 failed this metric
monit_wrapper does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.
No Binaries Metric
3.4.0 passed this metric
Publish Metric
3.4.0 passed this metric
Supported Platforms Metric
3.4.0 passed this metric
Testing File Metric
3.4.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.4.0 passed this metric
3.4.0 failed this metric
3.4.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
3.4.0 passed this metric
License Metric
3.4.0 failed this metric
monit_wrapper does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.
No Binaries Metric
3.4.0 passed this metric
Publish Metric
3.4.0 passed this metric
Supported Platforms Metric
3.4.0 passed this metric
Testing File Metric
3.4.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.4.0 passed this metric
3.4.0 passed this metric
3.4.0 failed this metric
monit_wrapper does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.
No Binaries Metric
3.4.0 passed this metric
Publish Metric
3.4.0 passed this metric
Supported Platforms Metric
3.4.0 passed this metric
Testing File Metric
3.4.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.4.0 passed this metric
3.4.0 passed this metric
3.4.0 passed this metric
Supported Platforms Metric
3.4.0 passed this metric
Testing File Metric
3.4.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.4.0 passed this metric
3.4.0 passed this metric
3.4.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.4.0 passed this metric
3.4.0 passed this metric