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


circonus (10) Versions 0.0.2

Circonus API client lib, resources, and such

cookbook 'circonus', '= 0.0.2'
cookbook 'circonus', '= 0.0.2', :supermarket
knife cookbook site install circonus
knife cookbook site download circonus

Circonus Cookbook


* A library class, Circonus, which acts as a Circonus API v2 client
* Integration with resmon cookbook (TODO)
* Chef Resources for:
  * circonus_check_bundle
  * circonus_metric
  * circonus_rule_set
  * circonus_rule
  * circonus_graph
  * circonus_graph_datapoint
* A default recipe that uses the node attributes to create the above resources


* None of the resources offer :delete actions yet
* Graph resource lacks facilities for access keys, guides, and composites
* Support for graphs in default recipe (attribute walker)
* Ability to control order of rules


circonus (circonus::default)

Optional. Lets you define circonus check bundles, metrics, and rules via the node's attributes. See the 'Cookbook Attributes' section for details on the expected attribute structure.



Manages a check bundle on circonus. Note that you MUST have at least one circonus_metric that refers to the circonus_check_bundle (a limitation of the API).

Actions: * :create - Create/Manage the check bundle

Resource Attributes:

* display_name - Display name of bundle, will appear in email subjects.  Uses resource name if not provided.
* target - Hostname or IP to query.  Defaults to node[:circonus][:target], which defaults to the node's guess_main_ip() according to NetInfo.
* type - Type of check, like :resmon or :http    
* brokers - Array of broker names.  Defaults to node[:circonus][:default_brokers]
* config - Hash of options specific to the check bundle type.  See 


circonus_check_bundle "foo-host Resmon" do
  type :resmon
  # Note that resmon URL MUST end in slash
  config { 'url' => '', 'port' => 81}


Manages a metric on circonus. Each metric must refer to a previously defined circonus_check_bundle resource.

Actions: * :create - Create/Manage the metric

Resource Attributes:

* name - Name of metric.  Consult your check type docs for information on what can go here.  Defaults to resource name.
* type - Type of value returned - one of :text, :numeric,  or :histogram
* check_bundle - Name of the check bundle resource that shoudl contain this metric.  Required.


circonus_metric "Core::Resmon`resmon`configstatus" do
  check_bundle "derm-dev-1 Resmon"
  type :text


Manages a ruleset on circonus, which allows you to trigger alerts/emails/pages. Each metric can have 0 or 1 rulesets per broker, and each ruleset may have 0-n rules. The ruleset gathers together the contact and response information, while the rules define the specific criteria under which the alert(s) will fire.

The name of this resource is arbitrary, but it is suggested that you use 'broker-name/metric-name' since that will be unique.

Actions: * :create - Create/manage the metric

Resource Attributes: * metric - Name of the circonus_metric resource this ruleset will be bound to. Must be defined prior to the circonus_rule_set . * broker - Name of the circonus broker that is collecting stats for the metric. You may repeat circonus_rule_sets on the same metric if you specify different brokers. * contact_groups - Ruby hash-of-arrays. Keys are the strings '1','2', .. '5', representing the severity levels. Values are arrays of string names of contact groups; when a rule fires at that severity level, all of the contact groups specified will be notified. You may omit entries for which you have no contact groups. * derive - Flag indicating whether the metric should be treated as a derivative (ie, watch for changes over time, rather than specific values). Values are :derive , :counter, or null. * link - An arbitrary URL that will be emailed to contact groups, presumably to assist in incident response. * notes - Arbitrary text that will be shown in the Circonus Web UI, presumably to assist in incident response.

TODO - add parent attribute


circonus_rule_set "agent-il-1/Core::Cpu`local`idle" do
   metric "Core::Cpu`local`idle"
   broker "agent-il-1"
   contact_groups '1' => [ "Chef Admins" ], '2' => [ ]
   link ''
   notes 'The very model of a modern major general'


Manages a single circonus rule. Relies on the circonus_rule_set resource already being defined.

BUG: There is no way to manage order of rules via this resource. Since the first rule to match wins, order matters.

The name of the resource is arbitrary.


* :create - Create/manage a circonus rule.

Resource Attributes:

* rule_set - Name of a circonus_rule_set chef resource, which must be defined prior to the rule resource.
* criteria - Operator to use to detect a match of the rule.  Valid values:
    * 'min value' - for numeric metrics
    * 'max value' - for numeric metrics
    * 'match' - regex, for text metrics
    * 'does not match' - regex, for text metrics
    * 'contains' - string, for text metrics
    * 'does not contain' - string, for text metrics
    * 'on change' - for text metrics, compares to last detected value
    * 'on absence' - for all metrics, detects metric loss of signal
* severity - Integer severity level, 1-5.  If this rule matches, the contact group(s) assigned in the rule_set to this severity level will be notified.
* value - Operand for those criteria that require one.  String.
* wait - Integer, delay in minutes to wait before alerting.  Use this to suppress false positives due to transients.


circonus_rule "agent-il-1/Core::Cpu`local`idle/25-idle" do
  rule_set "agent-il-1/Core::Cpu`local`idle"
  criteria 'min value'
  value 25
  severity 3
  wait 5


Manages a circonus graph. You can greate a graph independently of any check bundles or metrics. A graph may have 0 or more graph datapoints, which do rely on metrics.

Name of the resource is used as the graph title.


* :create - Create/Manage the graph

Resource Attributes:

* id - optional, GUID of the graph.  If provided, you can change the name of the graph; if omitted, changing the name of the graph will create a new graph.
* style - :line or :area
* max_left_y, max_right_y, min_left_y, min_right_y - Y Axis limits


Manages a data series on a graph. Relies on a circonus_metric resource definition, as well as agrpah definition. You must also provide the broker name, so we can resolve the check ID.

The name is used as the display name. The identity of the data point is derived from the metric and the broker.


* :create - Create/Manage a graph data series

Resource Attributes:

* graph - name of the circonus_graph chef resource on which to draw the data
* metric - name of the circonus_metric chef resource that provides the data
* broker - name of the broker, used to identify the check
* axis - :r or :l, which axis the the data should be measured against
* color - #FF00FF style; if omitted, circonus server will provide a default
* data_formula - see web UI help; may be left null
* legend_formula - see web UI help; may be left null
* hidden - true/false, false default
* derive - :counter, :derive, :gauge - :gauge is default

Cookbook Attributes

:circonus => {

    # Set this to false if you want to disable circonus actions
    :enabled => true, # Note: is set to false in vagranted-base

    # These attributes control behavior of the circonus cookbook at a low-level
    :api_token => 'some-string-here',  # Required - see
    # Note: app_token is a deprecated alias for api_token

    :target => '{{guess_main_ip()}}',           # By default, uses value of NetInfo.guess_main_ip
    :default_brokers => [ ],           # List of names of brokers, like 'agent-il-1', to use when creating check bundles        

    # The remaining attrs are a convenience
    # this tree gets interpreted by the circonus::default recipe to create chef resources from the node attributes
    :check_bundles => {
       'check bundle name' => {
          # These are required
          :type => 'resmon',
          :config => { :foo => 'bar' }, # See Circonus/Noit docs

          # These have defaults
          :target => 'defaults to guess_main_ip',
          :period => 60,
          :timeout => 10,
          :brokers => ['agent-foo-1', 'agent-foo-2'],

          # Deeper....
          :metrics => {
             # Names of metrics are usually determined by the type of the check bundle
             'Some::metric' => {
                 :type => :numeric, # or :text or :histogram

                 # You can stop at this point if you don't need alerts or graphs

                 # Rules
                 :rule_set => {
                    # Required
                    :contact_groups => { 
                       '1' => ['You', 'Your Mom'],   # These are names of the contact groups in Circonus; you can't just make them up
                       '3' => ['Bob']

                    # Optional
                    :link => '',
                    :derive => :counter, # null, the default, is most typical
                    :notes => 'If this alarm goes off, you are already doomed.',

                   # The rules themselves
                   :rules => [
                     :severity => 2,
                     :criteria => 'max value',
                     :value => '40',  
                     :wait => 13 ,
                     { ... }
             'Another::metric'  => { ... }

       'check bundle name 2' => { ... }


Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

circonus-checks Applicable Versions

No quality metric results found