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

Select Status

RSS

sensu-handlers (7) Versions 0.1.4

Installs/Configures sensu-handlers

Policyfile
Berkshelf
Knife
cookbook 'sensu-handlers', '= 0.1.4', :supermarket
cookbook 'sensu-handlers', '= 0.1.4'
knife supermarket install sensu-handlers
knife supermarket download sensu-handlers
README
Dependencies
Changelog
Quality 0%

Description

WORK IN PROGRESS

The mailer and pagerduty handlers/scripts are my first priority to get working. Due to some
differences in how the sensu puppet module and the sensu chef cookbook create handlers the
scripts are having some small refactoring done. I'm no Ruby or Chef wizard so
question/comments/concerns are welcome. Also right now writing spec and integration tests
haven't taken a priority, but once I'm closer to a stable first pass tests will be added.

sensu-handlers

This cookbook is a Chef implementation of Yelp's sensu_handlers Puppet module. The purpose of this
cookbook is to enable Sensu checks to be configured to define the desired handler behavior within
the check itself. This allows you to include a single handler (default) in the Sensu checks and
let the logic within the handlers, along with the additional check parameters to decide whether to
handle events. This cookbook also allows you to define a teams hash to provide more dynamic
contact routing.

WARNING: These handlers require special event data (such as the teams hash) in order to work.
If this data is not provided, these handlers will do nothing.

Setting node['sensu-handlers']['teams']

The simplest way to set the teams attribute is to do so explicitly within a recipe, but
you can also utilize a Chef data bag to store and load team information.

Set within recipe/atribute file

default['sensu-handlers']['teams'] = \ # add node.default... if setting within recipe
{
  ops: {
    pagerduty_api_key: '11111',
    notification_email: 'ops@mail.com'
  },
  devs: {
    pagerduty_api_key: '22222',
    pages_irc_channel: 'devs-pages',
    notifications_irc_channel: 'developers',
    notification_email: 'devs@mail.com'
  },
  hardware: {
    pagerduty_api_key: '11111',
    project: 'METAL'
  }
}

data_bag_item:

{
  "id": "default",
  "teams": {
    "ops": {
      "pagerduty_api_key": "11111",
      "notification_email": "ops@mail.com"
    },
    "devs": {
      "pagerduty_api_key": "22222",
      "pages_irc_channel": "devs-pages",
      "notifications_irc_channel": "developers",
      "notification_email": "devs@mail.com"
    },
    "hardware": {
      "pagerduty_api_key": "11111",
      "project": "METAL"
    }
  }
}

Set teams attribute in recipe by loading data bag item:

  data_bag_item = 'default'
  node.default['sensu-handlers']['teams'] = data_bag_item('sensu-handlers', data_bag_item['teams'])

Requirements

Platform:

No platforms defined

Cookbooks:

  • sensu (~> 2.10.0)

Attributes

  • node['sensu-handlers']['handler_dir'] - Directory where Sensu handler scripts are stored. Defaults to /opt/sensu/handlers.
  • node['sensu-handlers']['teams'] - Hash to define the different teams, which will effect the behavior of the handlers. Defaults to { ... }.
  • node['sensu-handlers']['default_handlers'] - Defaults to \.
  • node['sensu-handlers']['mail_from'] - Defaults to bke_sensu@#{node['domain']}.
  • node['sensu-handlers']['dashboard_link'] - Defaults to https://sensu.#{node['domain']}.
  • node['sensu-handlers']['enable_aws_prune'] - Boolean to determine if aws_prune recipe should be included. Defaults to false.
  • node['sensu-handlers']['jira_username'] - Defaults to sensu.
  • node['sensu-handlers']['jira_password'] - Defaults to sensu.
  • node['sensu-handlers']['jira_site'] - Defaults to jira.#{node['domain']}.
  • node['sensu']['use_ssl'] - Defaults to false.
  • node['sensu']['rabbitmq']['port'] - Defaults to 5672.
  • node['sensu']['use_embedded_ruby'] - Defaults to true.

Recipes

  • sensu-handlers::default
  • sensu-handlers::jira
  • sensu-handlers::mailer
  • sensu-handlers::nodebot
  • sensu-handlers::pagerduty

License and Maintainer

Maintainer:: Jacob Royal (j.w.r.1215@gmail.com)

License:: Apache 2.0

Dependent cookbooks

sensu ~> 2.10.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

sensu-handlers/ CHANGELOG

This file is used to list changes made in each version of the sensu-handlers/ cookbook.

0.1.0

  • [your_name] - Initial release of sensu-handlers/

Check the Markdown Syntax Guide for help with Markdown.

The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.

Foodcritic Metric
            

0.1.4 failed this metric

FC031: Cookbook without metadata file: /tmp/cook/6fb2307af571afcfda5c3b4c/sensu-handlers/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/6fb2307af571afcfda5c3b4c/sensu-handlers/metadata.rb:1