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 supermarket mailing list.

Select Badges

Select Supported Platforms


smartmontools (3) Versions 1.1.0

Installs and configures smartmontools

cookbook 'smartmontools', '~> 1.1.0'
cookbook 'smartmontools', '~> 1.1.0', :supermarket
knife cookbook site install smartmontools
knife cookbook site download smartmontools

Smartmontools Cookbook

Build Status Cookbook Version

This cookbook will install the smartmontools package and enable the service. It will also configure default email reports.



  • Ubuntu 12.04+
  • RHEL family (Redhat Enterprise, CentOS, etc)
  • Debian 6.0+


  • Chef 11+


  • none


  • node['smartmontools']['smartd_opts'] - sets the value for the smartd_opts in /etc/default/smartmontools. Default is "", which leaves the option commented.
  • node['smartmontools']['start_smartd'] - whether to start smartd service in /etc/default/smartmontools. Default is "yes".
  • node['smartmontools']['devices'] - Array of devices to monitor with the options used in smartd.conf. May also be a hash to provide different options for each device. Default is []. See Usage.
  • node['smartmontools']['device_opts'] - If set, these options will be used by default in /etc/smartd.conf for each of the devices above. Default is "-H -l error -l selftest".
  • node['smartmontools']['run_d'] - Array of scripts to drop off in /etc/smartmontools/run.d. Default is ["10mail"].



Note: The default /etc/smartd.conf configuration file from the package itself does not recommend using DEVICESCAN, despite it being enabled by default. The template will only use DEVICESCAN if node['smartmontools']['devices'] is not set.

The template for this file will iterate over the node['smartmontools']['devices'] attribute and write the configuration out. If no specific options are set for a device, it will get the options from node['smartmontools']['device_opts']. See Usage below.


Starts smartd by default using node['smartmontools']['start_smartd']. The enable_smart option is not recommended by smartmontools per the comment and is not managed via the template. Modify your local copy of the template if you wish to change this.

Cookbook Files


Each filename in the array node['smartmontools']['run_d'] will be dropped off via a cookbook file. By default the only one is 10mail, which exists, and came from the package. These files should be in files/default.


By default, the recipe is not set up to monitor any particular devices in smartd.conf, and will use DEVICESCAN. Set the attribute node['smartmontools']['devices'] to monitor a specific list of disk devices. If you don't require device specific options, this should be an array. A default set of options will be used for all disks from the node['smartmontools']['device_opts'] attribute.

For example:

name "base"
  "smartmontools" => {
    "devices" => ['sda','sdb','sr0'],
    "device_opts" => "-H -l error -l selftest -m"

If you need different configuration options for each device, specify the devices as Hash with the device name as key and the options as value. If the value for a device is nil, the default options from the node['smartmontools']['device_opts'] attribute are used. For example:

name "base"
  "smartmontools" => {
    "devices" => {
      "hda" => "-a -o on -S on -s (S/../.././02|L/../../6/03)",
      "hdb" => nil,
      "hdc" => nil
    "device_opts" => "-H -l error -l selftest -m"

For different kinds of hard drive configurations in your data center, use default_attributes in separate roles. For example if web servers have only a single internal disk, but database servers have two disks:

name "webserver"
    "smartmontools" => {
      "devices" => ['sda']

name "database_server
    "smartmontools" => {
      "devices" => ['sda', "sdb"]

License & Authors

Copyright 2011-2015, Joshua Timberman (

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,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

smartmontools Cookbook CHANGELOG

This file is used to list changes made in each version of the smartmontools cookbook.

1.1.0 (2017-02-04)

  • Move ownership of the cookbook to the Sous Chefs organization
  • Add full integration testing with kitchen-dokken in Travis CI
  • Add missing license file
  • Don't fail if there is no node['virtualization']
  • Add chefignore file to limit which files are uploaded to the chef server
  • Add gitignore, berksfile, Gemfile, Rakefile, and rubocop config files
  • Resolve cookstyle warnings
  • Add new supermarket metadata
  • Remove the init-smartmontools init script that wasn't used anymore
  • Remove support for Debian 6 in the metadata since its EoL and we don't support it
  • Remove workaround that supported Ubuntu 10.04

Collaborator Number Metric

1.1.0 passed this metric

Foodcritic Metric

1.1.0 passed this metric