broadinstitute/sensu-chef

Name: sensu-chef

Owner: Broad Institute

Description: Sensu Chef cookbook.

Created: 2014-01-07 15:29:13.0

Updated: 2015-01-13 19:55:12.0

Pushed: 2014-07-15 22:57:26.0

Homepage: http://community.opscode.com/cookbooks/sensu

Size: 611

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

DESCRIPTION

Provides LWRP's and service recipes to install and configure Sensu, a monitoring framework.

This cookbook provides the building blocks for creating a monitoring cookbook specific to your environment (wrapper). Without such a wrapper, no Sensu configuration files will be created for your nodes.

An example wrapper cookbook can be found HERE.

How to Write Reusable Chef Cookbooks

TESTING

This cookbook comes with a Gemfile, Cheffile, and a Vagrantfile for testing and evaluating Sensu.

xamples
install bundler
le install
arian-chef install
ant up
ant ssh
COOKBOOK DEPENDENCIES
REQUIREMENTS
SSL configuration

Running Sensu with SSL is recommended; this cookbook uses a data bag sensu, with an item ssl, containing the SSL certificates required. Sensu data bag items may be encrypted. This cookbook comes with a tool to generate the certificates and data bag item. If the integrity of the certificates is ever compromised, you must regenerate and redeploy them.

xamples/ssl
l_certs.sh generate
e data bag create sensu

Use the plain-text data bag item:

e data bag from file sensu ssl.json

Or, encrypted it with your data bag secret. See Encrypt a Data Bag for more information.

e data bag --secret-file /path/to/your/secret from file sensu ssl.json
shell
l_certs.sh clean
RECIPES
sensu::default

Installs Sensu and creates a base configuration file, intended to be extended. This recipe must be included before any of the Sensu LWRP's can be used. This recipe does not enable or start any services.

sensu::rabbitmq

Installs and configures RabbitMQ for Sensu, from configuring SSL to creating a vhost and credentials. This recipe relies heavily on the community RabbitMQ cookbook LWRP's.

sensu::redis

Installs and configures Redis for Sensu. This recipe uses the RedisIO cookbook and installs Redis from source.

sensu::server_service

Enables and starts the Sensu server.

sensu::client_service

Enables and starts the Sensu client.

sensu::api_service

Enables and starts the Sensu API.

sensu::dashboard_service

Enables and starts the Sensu dashboard.

ATTRIBUTES
Installation

node.sensu.version - Sensu build to install.

node.sensu.use_unstable_repo - If the build resides on the “unstable” repository.

node.sensu.directory - Sensu configuration directory.

node.sensu.log_directory - Sensu log directory.

node.sensu.log_level - Sensu log level (eg. “warn”).

node.sensu.use_ssl - If Sensu and RabbitMQ are to use SSL.

node.sensu.use_embedded_ruby - If Sensu Ruby handlers and plugins use the embedded Ruby in the Sensu package.

node.sensu.init_style - Style of init to be used when configuring Sensu services, “sysv” and “runit” are currently supported.

node.sensu.service_max_wait - How long service scripts should wait for Sensu to start/stop.

RabbitMQ

node.sensu.rabbitmq.host - RabbitMQ host.

node.sensu.rabbitmq.port - RabbitMQ port, usually for SSL.

node.sensu.rabbitmq.ssl - RabbitMQ SSL configuration, DO NOT EDIT THIS.

node.sensu.rabbitmq.vhost - RabbitMQ vhost for Sensu.

node.sensu.rabbitmq.user - RabbitMQ user for Sensu.

node.sensu.rabbitmq.password - RabbitMQ password for Sensu.

Redis

node.sensu.redis.host - Redis host.

node.sensu.redis.port - Redis port.

Sensu API

node.sensu.api.host - Sensu API host, for other services to reach it.

node.sensu.api.bind - Sensu API bind address.

node.sensu.api.port - Sensu API port.

Sensu Dashboard

node.sensu.dashboard.bind - Sensu Dashboard bind address.

node.sensu.dashboard.port - Sensu Dashboard port.

node.sensu.dashboard.user - Sensu basic authentication username.

node.sensu.dashboard.password - Sensu basic authentication password.

LWRP'S
Define a client
u_client node.name do
dress node.ipaddress
bscriptions node.roles + ["all"]
ditional(:cluster => node.cluster)

Define a handler
u_handler "pagerduty" do
pe "pipe"
mmand "pagerduty.rb"
verities ["ok", "critical"]

Define a check
u_check "redis_process" do
mmand "check-procs.rb -p redis-server -C 1"
ndlers ["default"]
bscribers ["redis"]
terval 30
ditional(:notification => "Redis is not running", :occurrences => 5)

Define a filter
u_filter "environment" do
tributes(:client => {:environment => "development"})
gate true

Define a mutator
u_mutator "opentsdb" do
mmand "opentsdb.rb"

Define a custom configuration snippet
u_snippet "irc" do
ntent(:uri => "irc://sensu:password@irc.freenode.net:6667#channel")

SUPPORT

Please visit sensuapp.org/support for details on community and commercial support resources, including the official IRC channel.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.