Coder Social home page Coder Social logo

chef-datadog's Introduction

Where to Find the Code

To submit issues and patches please visit https://github.com/DataDog/chef-datadog. The code is licensed under the Apache License 2.0 (see LICENSE for details).

Build Status

Datadog Cookbook

Chef recipes to deploy Datadog's components and configuration automatically.

Requirements

  • python >= 2.6
  • chef >= 10.12

Platform

  • Debian, Ubuntu, RedHat, CentOS

Cookbooks

The following Opscode cookbooks are dependencies:

  • apt
  • chef_handler
  • yum::epel

Attributes

  • node['datadog']['api_key'] = This needs to be retrieved from your Account Settings page.
  • node['datadog']['application_key'] = There are none by default. Visit the Account Settings page to create a new Application Key, to be used in conjunction with your API key.
  • node['datadog']['url'] = The location of where Datadog is hosted. Should never change.
  • node['datadog']['repo'] = Where the Datadog-maintained packages are located. Should never change.
  • node['datadog']['debug'] = Will trigger heavy logging to /tmp/dd-agent.log
  • node['datadog']['use_ec2_instance_id'] = Whether to use the instance-id in lieu of hostname when running on EC2. No effect on non-EC2 servers.
  • node['datadog']['use_mount'] = Whether to use the mount point instead of the device name for all I/O metrics.
  • node['datadog']['tags'] = List of Datadog tags you want to apply to this host
  • node['datadog']['dogstreams'] = List of Dogstreams (see Guide to Log Parsing for details).

apache

ganglia

  • node['ganglia']['url'] = Ganglia host where gmetad is running
  • node['ganglia']['port'] = Ganglia port where gmetad is running

graphite

  • node['datadog']['graphite'] = Turns the agent into a Graphite carbon relay.
  • node['datadog']['graphite_port'] = Port that the carbon relay will listen on.

haproxy

  • node['datadog']['haproxy']['stats_url'] = URL for haproxy stats
  • node['datadog']['haproxy']['stats_user'] = Optional HTTP Basic Auth user to access haproxy stats
  • node['datadog']['haproxy']['stats_password'] = Optional HTTP Basic Auth password to access haproxy stats

mysql

  • node['mysql']['server'] = MySQL host
  • node['mysql']['user'] = MySQL user. It only runs "SHOW STATUS" queries, which doesn't require any privileges, so you should consider creating a separate, unprivileged user.
  • node['mysql']['pass'] = MySQL user's password

postgres

  • node['postgres']['server'] = PostgreSQL host
  • node['postgres']['port'] = 5432 by default
  • node['postgres']['user'] = user that the agent will use to connect, "datadog" by default
  • node['postgres']['password'] = password to connect the datadog agent

Do not forget to update you pg_hba.conf and SIGHUP postgres in case your postgres access control requires it.

nginx

rabbitmq

mongodb

  • node['mongodb']['server'] = MongoDB uri. For example: mongodb://my_user:my_pass@localhost/my_db

couchdb

  • node['couchdb']['server'] = CouchDB host

jenkins

  • node['jenkins']['home_dir'] = Path to Jenkins's home directory

nagios

  • node['nagios']['log_dir'] = Path to Nagios's event log file
  • node['nagios']['conf_dir'] = If you use perfdata, dd-agent can import automatically and in real-time performance data collected by nagios. For more information on perfdata configuration, please refer to http://nagios.sourceforge.net/docs/3_0/perfdata.html. Path to Nagios' configuration file where the properties host|service_perfdata_file and host|service_perfdata_file_template are defined.

cassandra

  • Simply add the recipe datadog::cassandra to your role.

java

  • node['jvm_jmx']['server'] = JMX server:port to connect to
  • node['jvm_jmx']['user'] = JMX user to log in with, if needed
  • node['jvm_jmx']['pass'] = Password for the configured JMX user
  • node['jvm_jmx']['name'] = Name to report the statistics for this java VM. This will allow to monitor several JVMs running on the same machine.

tomcat

  • node['tomcat_jmx']['server'] = host:port to connect to. Must be configured in tomcat setenv.sh or similar
  • node['tomcat_jmx']['user'] = JMX user to log in with, if needed
  • node['tomcat_jmx']['pass'] = Password for the configured JMX user

varnish

  • node['varnish'] = if true, will invoke varnishstat on the server to gather varnish metrics.

memcached

  • node['memcached']['listen'] = memcached address; if 0.0.0.0 dd-agent will connect via the loopback address.
  • node['memcached']['port'] = memcached port

redis

  • node['redis']['server']['addr'] = redis server address
  • node['redis']['server']['port'] = redis server port

Recipes

default

Just a placeholder for now, when we have more shared components they will probably live there.

dd-agent

Installs the Datadog agent on the target system, sets the API key, and start the service to report on the local system metrics

dd-handler

Installs the chef-handler-datadog gem and invokes the handler at the end of a chef run to report the details back to the newsfeed.

Usage

  1. Add this cookbook to your Chef Server, either by installing with knife or downloading and uploading to your chef-server with knife.
  2. Add your API Key, either to attributes/default.rb, or by using the inheritance model and placing it on the node/
  3. Upload the new recipe via: knife cookbook upload datadog
  4. Associate the recipes with the desired roles, i.e. "role:chef-client" should contain "datadog::dd-handler" and a "role:somethingelse" should start the dd-agent with "datadog::dd-agent".
  5. Wait until chef-client runs on the target node (or trigger chef-client if you're impatient)

We are not making use of data_bags in this recipe at this time, as it is unlikely that you will have more than 1 API key.

Changes/Roadmap

v0.2.0

  • Revamped configuration of integrations using checks.d

v0.1.3

  • Work-around for COOK-2171

v0.1.2

  • Fixed typo in jmx section

v0.1.1

  • Added support for postgres, redis & memcached
  • dd-agent - updated to include more platforms
  • dd-handler - updated to leverage chef_gem resource if available
  • Updated copyright for 2012
  • Updated syntax for node attribute accessors
  • Some syntax styling fixes
  • Added agent logging configuration
  • Removed extraneous dependencies
  • Added automated testing suite

v0.0.12

  • Updated for CentOS dependencies

v0.0.11

  • Link to github repository.

v0.0.10

  • dd-handler - Corrects attribute name.

v0.0.9

  • dd-agent - Adds an explicit varnish attribute.

v0.0.8

  • dd-agent - Add varnish support.

v0.0.7

  • dd-agent - default to using instance IDs as hostnames when running dd-agent on EC2

v0.0.5

  • dd-agent - Full datadog.conf template using attributes (thanks @drewrothstein)

v0.0.4

  • dd-agent - Added support for Nagios PerfData and Graphite.

v0.0.3

  • dd-agent - Added support for RPM installs - Red Hat, CentOS, Scientific, Fedora

v0.0.2

  • Initial refactoring, including the dd-agent cookbook here
  • Adding chef-handler-datadog to report to the newsfeed
  • Added ruby-dev dependency

License and Author

Author:: Mike Fiedler ([email protected]) Author:: Alexis Le-quoc ([email protected])

Copyright 2012, Datadog, 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-datadog's People

Contributors

alq666 avatar miketheman avatar capttofu avatar dcrosta avatar wickett avatar markroddy avatar

Watchers

Simon McCartney avatar James Cloos 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.