Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms


poise-monit (11) Versions 1.0.1

A Chef cookbook for managing the Monit process manager.

cookbook 'poise-monit', '= 1.0.1'
cookbook 'poise-monit', '= 1.0.1', :supermarket
knife supermarket install poise-monit
knife supermarket download poise-monit
Quality 100%

Poise-Monit Cookbook

Build Status Gem Version Cookbook Version Coverage Gemnasium License

A Chef cookbook to manage Monit.

Quick Start

To install Monit and configure a mail server:

include_recipe 'poise-monit'

monit_config 'mailconfig' do
  content <<-EOH

To create a service managed by Monit with a health check:

poise_service 'apache2' do
  command '/usr/sbin/apache2 -f /etc/apache2/apache2.conf -DFOREGROUND'
  stop_signal 'WINCH'
  reload_signal 'USR1'
  provider :monit
  options :monit, checks: 'if failed host localhost port 80 protocol HTTP request "/" then restart'


  • poise-monit::default – Install Monit.


  • node['poise-monit']['default_recipe'] – Recipe used by the poise_service provider to install Monit if not already available. (default: poise-monit)
  • node['pose-monit']['provider'] – Default provider for monit resource instances. (default: auto)
  • node['poise-monit']['recipe'][*] – All subkeys of 'recipe' will be passed as properties to the monit resource before installation.

For example, the poise-monit recipe can be customized by setting:

  'poise-monit' => {
    'recipe' => {
      'daemon_interval' => 60,
      'event_slots' => 0,



The monit resource installs and configures Monit.

monit 'monit' do
  daemon_interval 60
  event_slots 1000


  • :enable – Install, enable and start Monit. (default)
  • :disable – Stop, disable, and uninstall Monit.
  • :start – Start Monit.
  • :stop – Stop Monit.
  • :restart – Stop and then start Monit.
  • :reload – Send SIGHUP signal to Monit.


  • service_name – Name of the Monit instance. (name attribute)
  • daemon_interval – Number of seconds between service checks. (default: 120)
  • event_slots – Number of slots in the Monit event buffer. Set to 0 to disable event buffering, or -1 for an unlimited queue. (default: 100)
  • httpd_port – Port to listen on for Monit's HTTPD. If a path is specified, it is used as a Unix socket path. If set to nil or false, no HTTPD configuration is generated. This may break some other poise-monit resources. (default: /var/run/monit.sock if the version of Monit supports it, otherwise 2812)
  • httpd_password – Cleartext password for authentication between the Monit daemon and CLI. Set to nil or false to disable authentication. (default: nil for Unix socket connections, otherwise auto-generated)
  • httpd_username – Username for authentication between the Monit daemon and CLI. (default: cli)
  • group – System group to deploy Monit as.
  • logfile – Path to the Monit log file. (default: /var/log/monit.log)
  • owner – System user to deploy Monit as.
  • path – Path to the Monit configuration directory. (default: /etc/monit)
  • pidfile – Path to the Monit PID file. (default: /var/run/
  • var_path – Path the Monit state directory. (default: /var/lib/monit)
  • version – Version of Monit to install.

Provider Options

The monit resource uses provide options for per-provider configuration. See the poise-service documentation for more information on using provider options.


The monit_config resource writes out a Monit configuration file to the conf.d/ directory.

monit_config 'ssh' do
  source 'monit_ssh.conf.erb'
  variables threshold: 5


  • :create – Create and manage the configuration file. (default)
  • :delete – Delete the configuration file.


  • config_name – Name of the configuration file. (name attribute)
  • content – File content to write.
  • cookbook – Cookbook to search for source in.
  • parent – Name or reference for the parent monit resource. (required, default: automatic)
  • path – Path to the configuration file. (default: automatic)
  • source – Template path to render.
  • variables – Template variables.

One of source or content is required.

Monit Providers


The binaries_bitbucket provider supports installing Monit from static binaries mirrored to BitBucket. This is the default provider if you are installing on an OS that has binaries available.

monit 'monit' do
  provider :binaries

NOTE: If BitBucket is unavailable you can set the url provider option to{version}/monit-%{version}-%{machine_label}.tar.gz to use downloads directly from, however this server has a relatively strict download quota system so this is not recommended.

Provider Options

  • path – Path to install Monit to. (default: /opt/monit-<version>)
  • retries – Number of times to retry failed downloads. (default: 5)
  • static_version – Full version number for use in interpolation. (default: automatic)
  • strip_components – Value to pass to tar --strip-components. (default: 1)
  • url – URL template to download from. (default:{version}-%{machine_label}.tar.gz)


The system provider supports installing Monit from system packages. This requires EPEL for RHEL/CentOS as they do not ship Monit in the base OS repositories. Because this is not a default provider, EPEL is not a dependency of this cookbook, you will have to add it to your run list or as a dependency of a wrapper cookbook.

monit 'monit' do
  provider :system

Provider Options

  • no_epel – Do not try to enable EPEL on EL nodes. (default: false)
  • package – Package name to install. (default: monit)


The dummy provider supports using the monit resource with ChefSpec or other testing frameworks to not actually install Monit. It is used by default under ChefSpec.

monit 'monit' do
  provider :dummy

Service Provider

The monit service provider is included to allow poise_service resources to use Monit as the service manager. This uses the normal sysvinit provider from poise-service to generate the init scripts, but manages service state through Monit.

poise_service 'apache2' do
  command '/usr/sbin/apache2 -f /etc/apache2/apache2.conf -DFOREGROUND'
  stop_signal 'WINCH'
  reload_signal 'USR1'
  provider :monit
  options :monit, checks: 'if failed host localhost port 80 protocol HTTP request "/" then restart'

To set the monit provider as the global default, use poise-sevice-monit.


Development sponsored by Bloomberg.

The Poise test server infrastructure is sponsored by Rackspace.


Copyright 2015, Noah Kantrowitz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Poise-Monit Changelog


  • Small fix for compatibility with poise-service-monit.


  • Initial release!

Foodcritic Metric

1.0.1 passed this metric