cookbook 'sensu_client', '~> 0.1.0'
sensu_client (1) Versions 0.1.0 Follow0
Install/Setup sensu-client on a node
cookbook 'sensu_client', '~> 0.1.0', :supermarket
knife supermarket install sensu_client
knife supermarket download sensu_client
sensu_client cookbook
A wrapper around the sensu cookbook to install & setup sensu-client on a node.
See sensuapp.com for more information about Sensu.
Requirements
sensu cookbook - https://github.com/sensu/sensu-chef
You need a Sensu server to connect to - for this, see my sensu_server cookbook.
Usage
You can set any of the sensu attributes detailed in the README for the sensu cookbook, but you really need to setup the rabbitmq attribute to connect to RabbitMQ on your Sensu server. The defaults are (at the time of writing) as follows:
[:sensu][:rabbitmq][:host] = 'localhost'
[:sensu][:rabbitmq][:port] = 5671
[:sensu][:rabbitmq][:vhost] = '/sensu'
[:sensu][:rabbitmq][:user] = 'sensu'
[:sensu][:rabbitmq][:password] = 'password'
If you are using SSL (recommended), you need to point the client at the same ssl certificates as the server is using.
If you used my sensu_server cookbook and ran the commands given and are using Chef Server, you should already have the sensu ssl data bag so do not need to do anything. If you are using Chef Solo or Vagrant, you will need to point your sensu client box at the same data bag.
If you are not using SSL (not recommended), you need to set [:sensu][:rabbitmq][:user_ssl] to false, as per the server.
Once you have the SSL certificates in place (or SSL disabled), include default recipe in your run list.
You can do this by including it as a dependancy (in metadata.rb) in your wrapper cookbook and using: include_recipe 'sensu_client', or by including sensu_client in a role or node's run list.
When running with Chef Server / Hosted Chef, i'd generally use a search to get the ip address of the monitoring server:
monitoring_ips = search(:node, "role:monitoring").map { |n| n['ipaddress'] }
if monitoring_ips.count > 0
node.normal[:sensu][:rabbitmq][:host] = monitoring_ips.first
end
node.normal[:sensu][:rabbitmq][:password] = 'mysecretpasswordhere'
include_recipe 'sensu_client'
When using Vagrant and Chef Solo, i'd set these as follows:
chef.json = {
:sensu => {
:rabbitmq => {
:host => '10.200.200.10',
:password => 'mysecretpasswordhere',
}
}
}
Attributes
There are a few configurable attributes for this cookbook:
[:sensu_client][:additional_attributes] - a hash of additional attributes to supply for this node's sensu-client configuration.
[:sensu_client][:sensu_plugin_version] - a specific version number of sensu-plugin to install. Leave this unset or false to install the latest.
[:sensu_client][:subscriptions] - an array of subscriptions. This defaults to 'all' plus any roles the node has (eg: all, web).
You can also set any of the sensu attributes detailed in the README for the sensu cookbook.
For example, if you wanted to turn off SSL (not recommend), then you could do this:
In a recipe:
node.override[:sensu][:use_ssl] = false
In an attributes file:
override[:sensu][:use_ssl] = false
Recipes
default - install sensu and setup the sensu-client service.
Author
Author:: Ian Chilton (ian@ichilton.co.uk)
Dependent cookbooks
sensu >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: sensu_client/metadata.rb:1
FC065: Ensure source_url is set in metadata: sensu_client/metadata.rb:1
FC066: Ensure chef_version is set in metadata: sensu_client/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: sensu_client/metadata.rb:1
FC065: Ensure source_url is set in metadata: sensu_client/metadata.rb:1
FC066: Ensure chef_version is set in metadata: sensu_client/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
FC065: Ensure source_url is set in metadata: sensu_client/metadata.rb:1
FC066: Ensure chef_version is set in metadata: sensu_client/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 passed this metric