cookbook 'sensu-handlers', '= 0.1.3'
sensu-handlers (7) Versions 0.1.3 Follow0
Installs/Configures sensu-handlers
cookbook 'sensu-handlers', '= 0.1.3', :supermarket
knife supermarket install sensu-handlers
knife supermarket download sensu-handlers
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 tobke_sensu@#{node['domain']}
. -
node['sensu-handlers']['dashboard_link']
- Defaults tohttps://sensu.#{node['domain']}
. -
node['sensu-handlers']['enable_aws_prune']
- Boolean to determine if aws_prune recipe should be included. Defaults tofalse
. -
node['sensu-handlers']['jira_username']
- Defaults tosensu
. -
node['sensu-handlers']['jira_password']
- Defaults tosensu
. -
node['sensu-handlers']['jira_site']
- Defaults tojira.#{node['domain']}
. -
node['sensu']['use_ssl']
- Defaults tofalse
. -
node['sensu']['rabbitmq']['port']
- Defaults to5672
. -
node['sensu']['use_embedded_ruby']
- Defaults totrue
.
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.3 failed this metric
FC031: Cookbook without metadata file: /tmp/cook/f8ab9f12fb866c40a14faaa3/sensu-handlers/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/f8ab9f12fb866c40a14faaa3/sensu-handlers/metadata.rb:1
FC047: Attribute assignment does not specify precedence: /tmp/cook/f8ab9f12fb866c40a14faaa3/sensu-handlers/recipes/pagerduty.rb:16
0.1.3 failed this metric
FC045: Consider setting cookbook name in metadata: /tmp/cook/f8ab9f12fb866c40a14faaa3/sensu-handlers/metadata.rb:1
FC047: Attribute assignment does not specify precedence: /tmp/cook/f8ab9f12fb866c40a14faaa3/sensu-handlers/recipes/pagerduty.rb:16