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

rackspace_monitoring (10) Versions 1.1.2

Installs/Configures rackspace_monitoring

Policyfile
Berkshelf
Knife
cookbook 'rackspace_monitoring', '= 1.1.2', :supermarket
cookbook 'rackspace_monitoring', '= 1.1.2'
knife supermarket install rackspace_monitoring
knife supermarket download rackspace_monitoring
README
Dependencies
Changelog
Quality 83%

Circle CI

rackspace_monitoring-cookbook

The Rackspace Cloud-monitoring cookbook provides resource primitives (LWRPs) for use in recipes.
The goal is to offer resources to configure Rackspace Cloud-monitoring

In scope

This cookbook focuses on installing the Rackspace monitoring agent and creating check/alarms. Future plans include to support non-cloud servers.

Out of scope

This cookbook has not been designed to directly call Rackspace API. Instead it relies on the Rackspace monitoring agent.

Supported Platforms

  • Centos 6.5
  • Ubuntu 12.04
  • Ubuntu 14.04

Windows is not supported yet.

Usage

Place a dependency on the rackspace_monitoring cookbook in your cookbook's metadata.rb

depends 'rackspace_monitoring'

Then, in a recipe:

rackspace_monitoring_service 'default' do
  cloud_credentials_username 'my_user'
  cloud_credentials_api_key 'uc60892165188d7i786p833917a3v7613'
  action [:create, :start]
end

rackspace_monitoring_check 'filesystem' do
  type 'agent.filesystem'
  target '/var'
  alarm true
  action :create
end

Resources

rackspace_monitoring_service

The rackspace_monitoring_service resources manages the basic plumbing needed to get a rackspace-monitoring agent instance running with minimal configuration.

The :create action handles package installation. The internal configuration file contains just enough to get the service up and running, then loads extra configuration from a rackspace-monitoring-agent.conf.d directory.

Parameters

  • cloud_credentials_username - Your cloud username
  • cloud_credentials_api_key - Your cloud api-key
  • package_name - Rackspace monitoring agent package name (default to rackspace-monitoring-agent)
  • package_action - Which action to run when :create default to install
  • create_entity - Automatically create an Entity during :create to associate with Checks (default to false)

Actions

  • :create - Configures everything but the underlying operating system service
  • :delete - Removes everything
  • :start - Starts the underlying operating system service
  • :stop - Stops the underlying operating system service
  • :restart - Restarts the underlying operating system service
  • :reload - Reloads the underlying operating system service
  • :disable/:enable Enables/Disables the underlying operating system service

rackspace_monitoring_check

The rackspace_monitoring_check resources creates the agent configuration for a defined type.

The :create action handles package installation. The internal configuration file contains just enough to get the service up and running, then loads extra configuration from a rackspace-monitoring-agent.conf.d directory.

Parameters

Common to all checks
  • :label - optional - A friendly label for a check - Default : Check for :type
  • :agent_filename - optional - File name used to create the agent configuration - Default : same as :type. If you use the same agent type more than once in a recipe then you should set :agent_filename, as otherwise your agents configuration will conflict as they will have the same filename.
  • :alarm - optional - Enable or disable the alarm on a check - Default : false
  • :alarm_criteria - optional - Criteria used to trigger alarms - Default : agent specific ./libaries/helpers.rb => parsed_alarm_criteria
  • :period - optional - The period in seconds for a check. The value must be greater than the minimum period set on your account -Default : 90
  • :timeout - optional - The timeout in seconds for a check. This has to be less than the period - Default : 30
  • :critical - optional - Threshold for the default alarm criteria - Default : 95
  • :warning - optional - Threshold for the default alarm criteria - Default : 90
  • :notification_plan_id - optional - Notification plan for the alarms - Default : npTechnicalContactsEmail
  • :variables - optional - Additional variables you want to use in the template.variable_name => 'value'. It will allow to add attributes to the agent configuration if you need more than the default ones. Here is an example for remote.http. If you want to create your own :template you can use all the :variables with @variable_name.
Used on some checks (filesystem/disk/network)
  • :target - used for filesystem/disk/network only
    • disk : The disk to check (eg '/dev/xvda1') String/Array - Default : Create one file per /dev/(sd|vd|xvd|hd)
    • filesystem : The mount point to check (eg '/var' or 'C:') String/Array - Default : Create one file per filesystem
    • network : The network device to check (eg 'eth0') - Default : Fallback to the default interface
  • :target_hostname - required for http only - Server to request for the HTTP check
  • :send_warning - required for network only - Threshold for the default send alarm criteria - Default : 18350080
  • :send_critical - required for network only - Threshold for the default send alarm criteria - Default : 24903680
  • :recv_warning - required for network only - Threshold for the default receive alarm criteria - Default : 18350080
  • :recv_critical - required for network only - Threshold for the default send alarm criteria - Default : 24903680
Plugins attributes
  • :plugin_url - optional if :plugin_filename has been provided, ignored if :plugin_cookbook is provided - Url from where to download a plugin. i.e https://raw.githubusercontent.com/racker/rackspace-monitoring-agent-plugins-contrib/master/chef_node_checkin.py
  • :plugin_args - optional - Arguments to pass to the plugin (Array)
  • :plugin_filename - optional if :plugin_url has been provided, mandatory otherwise.
  • :plugin_cookbook - optional - Cookbook to load a plugin template from. i.e wrapper or base site-cookbooks - Default : nil
  • :plugin_timeout - optional - The timeout for the plugin execution in milliseconds - Default : 60000
Template config

Actions

  • :create - Create an agent configuration
  • :delete - Removes an agent configuration (will not remove the check)
  • :disable/:enable Disable/enable the agent check.

Examples

CPU agent with alarm enabled

rackspace_monitoring_check 'Cpu check' do
  type 'agent.cpu'
  alarm true
  action :create
end

Create a new agent config from scratch

By example remote.ping which is not a supported type

rackspace_monitoring_check 'custom' do
  type 'remote.ping'
  cookbook 'rackspace_monitoring_check_test'
  template 'user_defined.conf.erb'
  alarm true
  variables 'count' => '10'
  action :create
end

Then you can have your own template :

type: remote.ping
label: Remote ping check on <%= @target_hostname %>
disabled: <%= @disabled %>
period: <%= @period %>
timeout: <%= @timeout %>
target_hostname: <%= @target_hostname %>
monitoring_zones_poll:
  - mzdfw
  - mzord
  - mziad
details:
  <% @variables.each do |param,value| %>
  <%= param -%>: <%= value %>
  <% end %>

Create a http agent but add some variables not exposed by the resource as parameters

hostname = 'dummyhost.com'
rackspace_monitoring_check 'http' do
  type 'remote.http'
  target_hostname hostname
  alarm true
  variables 'url' => "http://#{hostname}/healthcheck",
            'body' => 'Status OK'
  action :create
end

Create a plugin check chef_node_checkin(rackspace-monitoring-agent-plugins-contrib)

rackspace_monitoring_check 'agent.plugin' do
  type 'agent.plugin'
  plugin_url 'https://raw.githubusercontent.com/racker/rackspace-monitoring-agent-plugins-contrib/master/chef_node_checkin.py'
  plugin_args '--debug'
  plugin_filename 'awesome_plugin.py'
  alarm true
  action :create
end

References

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (i.e. add-new-recipe)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request

License and Authors

Authors:: Julien Berard (julien.berard@rackspace.co.uk)

rackspace_monitoring CHANGELOG

1.1.2

  • #37 - updates to the agent.plugin template
  • #33 - Adds a package_channel attribute to rackspace_monitoring_service to allow choosing the unstable channel. I deliberately left that out of the docs as I don't want to encourage use of unstable, but it's useful for testing the cookbook against upcoming agent releases. Prevents hanging the Chef run while the agent prompts for input if create_entity is false on a rackspace_monitoring_service resource. The --no-entity flag was added in version 2.2.10. Older versions will ignore the flag.
  • #31 - update logic behind identifying best IP address

1.1.1

  • #29, #30 - fix the interpretation of plugin arguments, fix template escapes

1.1.0

  • #18 - add plugin_cookbook as alternate way to install agent plugins
  • #21 - fix some rubocop and other style issues
  • #6 - add plugin_cookbook as alternate way to install agent plugins
  • #15 - fix agent.custom template yaml syntax
  • #12 - Ensure templates correctly use int, not string

1.0.6

  • added support for agent_filename

1.0.5

  • Ensure a downloaded plugin is executable

1.0.4

  • Handle parsing filename even if type is not agent.plugin

1.0.3

  • Changed cookbook_name template variable to cookbook
  • Fixed hard coded notification plan in remote.http check

1.0.2

  • fixed missing { in memory alarm

1.0.1

  • Updated some metadatas

1.0.0

  • Rename cookbook
  • First stable release

0.0.7

  • more integration tests
  • alarm criteria have their own templates

0.0.6

  • Updated default threshold for Network check

0.0.5

  • Fixed behavior on auto-target without alarm #10

0.0.4

  • No default alarm_criteria for agent.disk, disable alarm if automatic target detection and no alarm_criteria

Collaborator Number Metric
            

1.1.2 passed this metric

Contributing File Metric
            

1.1.2 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
            

1.1.2 passed this metric

No Binaries Metric
            

1.1.2 passed this metric

Testing File Metric
            

1.1.2 passed this metric

Version Tag Metric
            

1.1.2 passed this metric