Giter Site home page Giter Site logo

rhenning / chef-cloudkick-neat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hosh/cloudkick

0.0 1.0 0.0 117 KB

Development repository for Opscode Cookbook cloudkick

Home Page: http://community.opscode.com/cookbooks/cloudkick

License: Apache License 2.0

Ruby 100.00%

chef-cloudkick-neat's Introduction

Description

Installs and configures the Cloudkick Agent, and integrates it with Chef.

Requirements

Forked from Opscode repository and backported to chef < 0.10.10, ohai < 0.6.12

Platform

Platform families Debian, RHEL and Fedora are supported in the general sense, though not all may have appropriate Cloudkick packages available upstream.

Cookbooks

  • apt
  • yum

The apt_repository and yum_repository LWRPs are used from these cookbooks to create the proper repository entries so the Cloudkick agent can be downloaded and installed.

Attributes

  • node['cloudkick']['oauth_key'] - the OAuth key used for authentication with the Cloudkick API.
  • node['cloudkick']['oauth_secret'] - the OAuth secret used for authentication with the Cloudkick API.
  • node['cloudkick']['data'] - data for the Cloudkick API about the node

Resources & Providers

This cookbook contains two Resource Providers:

  • cloudkick_check - For creating & manipulating Cloudkick Checks.
  • cloudkick_monitor - For creating & manipulating Cloudkick Monitors.

Example Usage:

Create a Cloudkick Monitor for all of our appservers:

cloudkick_monitor "appserver monitor" do
  oauth_key 'xxx'
  oauth_secret 'yyy'
  query 'tag:appserver'
  action :create
end

Create a Cloudkick Check for the root partition on our appservers:

cloudkick_check "root check" do
  oauth_key 'xxx'
  oauth_secret 'yyy'
  code 51 # 'DISK'
  details({:path => '/', :fs_critical => 99, :fs_warn => 95})
  monitor_id 'q1234'
  action :create
end

Usage

In order for the agent to function, you'll need to have defined your Cloudkick API key and secret. We recommend you do this in a Role, which should also take care of applying the cloudkick::default recipe.

Assuming you name the role 'cloudkick', here is the required json:

{
  "name": "cloudkick",
  "chef_type": "role",
  "json_class": "Chef::Role",
  "default_attributes": {

  },
  "description": "Configures Cloudkick",
  "run_list": [
    "recipe[cloudkick]"
  ],
  "override_attributes": {
    "cloudkick": {
      "oauth_key": "YOUR KEY HERE"
      "oauth_secret": "YOUR SECRET HERE"
    }
  }
}

If you want Cloudkick installed everywhere, we recommend you just add the cloudkick attributes to a base role.

All of the data about the node from Cloudkick is available in node['cloudkick'] - for example:

"cloudkick": {
  "oauth_key": "YOUR KEY HERE",
  "oauth_secret": "YOUR SECRET HERE",
  "data": {
    "name": "slice204393",
    "status": "running",
    "ipaddress": "173.203.83.199",
    "provider_id": "padc2665",
    "tags": [
      "agent",
      "cloudkick"
    ],
    "agent_state": "connected",
    "id": "n87cfc79c5",
    "provider_name": "Rackspace",
    "color": "#fffffff"
  }
}

Of particular interest is the inclusion of the Cloudkick tags. This will allow you to search Chef via tags placed on nodes within Cloudkick:

$ knife search node 'cloudkick_data_tags:agent' -a fqdn
{
  "rows": [
    {
      "fqdn": "slice204393",
      "id": "slice204393"
    }
  ],
  "start": 0,
  "total": 1
}

We automatically add a tag for each Role applied to your node. For example, if your node had a run list of:

"run_list": [ "role[webserver]", "role[database_master]" ]

The node will automatically have the 'webserver' and 'database_master' tags within Cloudkick.

License and Author

Author:: Adam Jacob ([email protected]) Author:: Seth Chisamore ([email protected]) Copyright:: 2010-2011, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

chef-cloudkick-neat's People

Contributors

adamhjk avatar nathenharvey avatar schisamo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.