Chef

ENTERPRISE: Built-in integrations are available for Sensu Enterprise users only.

Overview

Deregister Sensu clients from the client registry, if they no longer have associated Chef node data. This integration can only work if Sensu clients are named using the Chef node name, for the machine on which they reside. The chef enterprise handler requires Chef Server API credentials, the local chef-client configuration can be used as a reference.

Configuration

Example(s)

The following is an example global configuration for the chef enterprise handler (integration).

{
  "chef": {
    "endpoint": "https://api.chef.io/organizations/example",
    "flavor": "enterprise",
    "client": "i-424242",
    "key": "/etc/chef/i-424242.pem",
    "ssl_pem_file": "/etc/chef/ssl.pem",
    "ssl_verify": true,
    "proxy_address": "proxy.example.com",
    "proxy_port": 8080,
    "proxy_username": "chef",
    "proxy_password": "secret",
    "timeout": 10
  }
}

Integration Specification

NOTE: the following integration definition attributes may be overwritten by the corresponding Sensu client definition chef attributes, which are included in event data.

chef attributes

The following attributes are configured within the {"chef": {} } configuration scope.

endpoint
description The Chef Server API endpoint (URL).
required true
type String
example
"endpoint": "https://api.chef.io/organizations/example"
flavor
description The Chef Server flavor (is it enterprise?).
required false
type String
allowed values enterprise (for Hosted Chef and Enterprise Chef) and open_source (for Chef Zero and Open Source Chef Server)
example
"flavor": "enterprise"
client
description The Chef Client name to use when authenticating/querying the Chef Server API.
required true
type String
example
"client": "sensu-server"
key
description The Chef Client key to use when authenticating/querying the Chef Server API.
required true
type String
example
"key": "/etc/chef/i-424242.pem"
ssl_pem_file
description The Chef SSL pem file use when querying the Chef Server API.
required false
type String
example
"ssl_pem_file": "/etc/chef/ssl.pem"
ssl_verify
description If the SSL certificate will be verified when querying the Chef Server API.
required false
type Boolean
default true
example
"ssl_verify": false
proxy_address
description The HTTP proxy address.
required false
type String
example
"proxy_address": "proxy.example.com"
proxy_port
description The HTTP proxy port (if there is a proxy).
required false
type Integer
example
"proxy_port": 8080
proxy_username
description The HTTP proxy username (if there is a proxy).
required false
type String
example
"proxy_username": "chef"
proxy_password
description The HTTP proxy user password (if there is a proxy).
required false
type String
example
"proxy_password": "secret"
filters
description An array of Sensu event filters (names) to use when filtering events for the handler. Each array item must be a string. Specified filters are merged with default values.
required false
type Array
default
["handle_when", "check_dependencies"]
example
"filters": ["recurrence", "production"]
severities
description An array of check result severities the handler will handle. NOTE: event resolution bypasses this filtering.
required false
type Array
allowed values ok, warning, critical, unknown
example
 "severities": ["critical", "unknown"]
timeout
description The handler execution duration timeout in seconds (hard stop).
required false
type Integer
default 10
example
"timeout": 30