Itamae plugin to install & configure sensu.
WARNING: Under development yet !
NOTE: This recipe/resource is implemented by referene to sensu/sensu-chef.
Add this line to your application's Gemfile:
gem 'itamae-plugin-recipe-sensu'
And then execute:
$ bundle
Or install it yourself as:
$ gem install itamae-plugin-recipe-sensu
Install & configure redis.
# your recipe
include_recipe 'sensu::redis'
NOTE: depends on itamae-plugin-recipe-redis plugin.
Install RabbitMQ.
# your recipe
include_recipe 'sensu::rabbitmq'
NOTE: depends on itamae-plugin-recipe-rabbitmq plugin.
Install sensu package.
# your recipe
include_recipe 'sensu::package'
Enable sensu-client service.
# your recipe
include_recipe 'sensu::client_service'
Enable sensu-server service.
# your recipe
include_recipe 'sensu::server_service'
Enable sensu-api service.
# your recipe
include_recipe 'sensu::api_service'
See attribuets/defaults.yml
about default values.
name | description |
---|---|
node.sensu.user | The user who owns all Sensu files and directories. Default 'sensu' |
node.sensu.group | The group that owns all Sensu files and directories. Default 'sensu' |
node.sensu.use_embedded_ruby | The flag means whether Sensu ruby handlers and plugins use the embedded ruby in the Sensu package, or not use. (default: true) |
node.sensu.log_directory | Sensu log directory. |
node.sensu.log_level | Sensu log level (default: info) |
node.sensu.service_max_wait | How long service scripts should wait for Sensu to start/stop |
name | description |
---|---|
node.sensu.rabbitmq.host | RabbitMQ host |
node.sensu.rabbitmq.port | RabbitMQ port |
node.sensu.rabbitmq.vhost | RabbitMQ vhost for Sensu |
node.sensu.rabbitmq.user | RabbitMQ user for Sensu |
node.sensu.rabbitmq.password | RabbitMQ password for Sensu |
- WARNING: This plugin does not support configuration about RabbitMQ ssl. This may be cause of Security Issue.
- WARNING:
sensu.core.rabbitmq.port
attribute is not used yet...
name | description |
---|---|
node.sensu.redis.host | Redis host |
node.sensu.redis.port | Redis port |
name | description |
---|---|
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 |
# your recipe
sensu_client 'localhost' do
address '127.0.0.1'
subscription_names ['all']
keepalive(
thresholds: {
warning: 10,
critical: 180
},
handlers: ['default'],
refresh: 180
)
additional(
description: 'sample host'
)
end
With default attributes, this code create config file to /etc/sensu/conf.d/client.json
.
sensu_handler 'pagerduty' do
type 'pipe'
command 'pagerduty.rb'
severities ['ok', 'critical']
end
With default attributes, this code create config file to /etc/sensu/conf.d/handlers/pagerduty.json
.
sensu_check 'redis_process' do
command 'check-procs.rb -p redis-server -C 1'
handlers ['default']
subscribers ['redis']
interval 30
additional(
notification: 'Redis is not running',
occurrences: 5
)
end
With default attributes, this code create config file to /etc/sensu/conf.d/checks/redis_process.json
.
sensu_filter 'environment' do
attributes(
client: {
environment: 'development'
}
)
negate true
end
With default attributes, this code create config file to /etc/sensu/conf.d/filters/environment.json
.
sensu_mutator 'opentsdb' do
command 'opentsdb.rb'
end
With default attributes, this code create config file to /etc/sensu/conf.d/mutators/opentsdb.json
.
sensu_gem 'sensu-plugins-apache' do
action :install
end
Install 'sensu-plugins-apache' gem with embedded rubygem by sensu package (/opt/sensu/embedded/bin/gem
).
- Fork it ( https://github.com/[my-github-username]/itamae-plugin-recipe-sensu/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Copyright 2015 Leonis & Co.
MIT License