cookbook 'rackspace_cloud_monitoring', '~> 0.0.8'
The rackspace_cloud_monitoring cookbook has been deprecated
Author provided reason for deprecation:
The rackspace_cloud_monitoring cookbook has been deprecated and is no longer being maintained by its authors. Use of the rackspace_cloud_monitoring cookbook is no longer recommended.
You may find that the rackspace_monitoring cookbook is a suitable alternative.
rackspace_cloud_monitoring (2) Versions 0.0.8 Follow0
Installs/Configures rackspace_cloud_monitoring
cookbook 'rackspace_cloud_monitoring', '~> 0.0.8', :supermarket
knife supermarket install rackspace_cloud_monitoring
knife supermarket download rackspace_cloud_monitoring
rackspace_cloud_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_cloud_monitoring cookbook in your cookbook's metadata.rb
depends 'rackspace_cloud_monitoring'
Then, in a recipe:
rackspace_cloud_monitoring_service 'default' do
cloud_credentials_username 'my_user'
cloud_credentials_api_key 'uc60892165188d7i786p833917a3v7613'
action [:create, :start]
end
rackspace_cloud_monitoring_check 'filesystem' do
type 'agent.filesystem'
target '/var'
alarm true
action :create
end
Resources
rackspace_cloud_monitoring_service
The rackspace_cloud_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 torackspace-monitoring-agent
) -
package_action
- Which action to run when:create
default toinstall
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_cloud_monitoring_check
The rackspace_cloud_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
-
: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 forremote.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 - 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_timeout
- optional - The timeout for the plugin execution - Default : 30
Template config
-
:cookbook
- optional - Where to look for the agent yaml template - Default : 'rackspace_cloud_monitoring' -
:template
- optional - Where to look for the agent yaml template - Default : ':type
.conf.erb' orcustom_check.conf.erb
-
:type
- required - Which kind of agent to configure. Supported agents :- agent.memory
- agent.cpu
- agent.load
- agent.filesystem
- agent.disk
- agent.network
- agent.plugin
- remote.http
- anything else will load
custom_check.conf.erb
and all the parameters and variables will be available in the template. Rackspace check types
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_cloud_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_cloud_monitoring_check 'custom' do
type 'remote.ping'
cookbook 'rackspace_cloud_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_cloud_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_cloud_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
- Fork the repository on Github
- Create a named feature branch (i.e.
add-new-recipe
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request
License and Authors
Authors:: Julien Berard (julien.berard@rackspace.co.uk)
Dependent cookbooks
apt >= 0.0.0 |
yum >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
rackspace_cloud_monitoring CHANGELOG
0.0.8
- fixed memory alarm logic template
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
0.0.8 passed this metric
Contributing File Metric
0.0.8 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.0.8 passed this metric
No Binaries Metric
0.0.8 passed this metric
Testing File Metric
0.0.8 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.0.8 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 include a tag that matches this cookbook version number
0.0.8 passed this metric
0.0.8 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.0.8 passed this metric
No Binaries Metric
0.0.8 passed this metric
Testing File Metric
0.0.8 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.0.8 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 include a tag that matches this cookbook version number
0.0.8 passed this metric
0.0.8 passed this metric
Testing File Metric
0.0.8 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.0.8 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 include a tag that matches this cookbook version number
0.0.8 failed this metric
0.0.8 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 include a tag that matches this cookbook version number