Git Product home page Git Product logo

diamond_cookbook's Introduction

About

Diamond is a python daemon that collects system metrics and publishes them to Graphite. It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.

The documentation can be found on our wiki. For your convenience the wiki is setup as a submodule of this checkout. You can get it via running

git submodule init
git submodule update

Definitions

This cookbook has a definition to make it easy to create collector configs. By default, the definition enables the collector. You can supply it with addition parameters. Below is the simplest example.

    collector_config "CPUCollector"

This simple example just enables the collector and it inhereits the default configuration for this collector as defined by the collector.

You can override these default settings by passing additional parameters. Below is an example of this.

    collector_config "DiskSpaceCollector" do
      filesystems      'ext2,ext3,xfs'
      exclude_filters  "'^/export/home'"
    end

This example is enabling the DiskSpaceCollector while passing addition settings to specify which filesystems to mine data and to exclude certain directories (regex). Read the documentation/collector source code for information on what parameters each collector has. It is recommended that instead of passing values directly, inherit them from the node (as show belown).

    collector_config "DiskSpaceCollector" do
      filesystems      node[:diamond][:collectors][:DiskSpaceCollector][:filesystems]
      exclude_filters  node[:diamond][:collectors][:DiskSpaceCollector][:exclude_filters]
    end

When you are collecting data via snmp, you need to specify that in the definition (as shown below)

      collector_config "SNMPInterfaceCollector" do
        path      node[:diamond][:collectors][:SNMPInterfaceCollector][:path]
        snmp      true
        interval  node[:diamond][:collectors][:SNMPInterfaceCollector][:interval]
        time__out node[:diamond][:collectors][:SNMPInterfaceCollector][:timeout]
        retries   node[:diamond][:collectors][:SNMPInterfaceCollector][:retries]
        port      node[:diamond][:collectors][:SNMPInterfaceCollector][:port]
        community node[:diamond][:collectors][:SNMPInterfaceCollector][:community]
        devices   node[:diamond][:collectors][:SNMPInterfaceCollector][:devices]
      end

Whats with the double underscore ('')? if a double underscore exists in the attribute name, it will be automatically removed when written to the collector config file. This is due to limitations within ruby code. Sometimes a attibute name may be a reserved ruby word (ie timeout), in which case, you can't use that key to specify an attribute for the collector. The use of double underscores ('') is a work around for that. (so 'timeout' is called as 'time__out' in the cookbook, but writes 'timeout' to the config file.

USAGE

It is recommended that you create a recipe per collector, and add that recipe to the related role. When passing sensitive data to a diamond collector config (ie a username, password, etc), use data bags to encrypt the values.

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.