Puppet Class: cloudinsight_agent::integrations::http_check

Inherits:
cloudinsight_agent::params
Defined in:
manifests/integrations/http_check.pp

Overview

Class: cloudinsight_agent::integrations::http_check

This class will install the necessary config to hook the http_check in the agent

Parameters:

url
timeout

username
password
    If your service uses basic authentication, you can optionally
    specify a username and password that will be used in the check.

threshold
window
    The (optional) window and threshold parameters allow you to trigger
    alerts only if the check fails x times within the last y attempts
    where x is the threshold and y is the window.

include_content
    The (optional) collect_response_time parameter will instruct the
    check to create a metric 'network.http.response_time', tagged with
    the url, reporting the response time in seconds.

collect_response_time
    The (optional) collect_response_time parameter will instruct the
    check to create a metric 'network.http.response_time', tagged with
    the url, reporting the response time in seconds.

disable_ssl_validation
    The setting disable_ssl_validation parameter to true will instruct
    the http client to accept self signed, expired and otherwise
    problematic SSL server certificates. To maintain backwards
    compatibility this defaults to false.

headers
    The (optional) headers parameter allows you to send extra headers
    with the request. This is useful for explicitly specifying the host
    header or perhaps adding headers for authorisation purposes. Note
    that the http client library converts all headers to lowercase.
    This is legal according to RFC2616
    (See: http://tools.ietf.org/html/rfc2616#section-4.2)
    but may be problematic with some HTTP servers
    (See: https://code.google.com/p/httplib2/issues/detail?id=169)

contact
    For service-specific notifications, you can optionally specify
    a list of users to notify within the service configuration.

tags

Sample Usage:

class { ‘cloudinsight_agent::integrations::http_check’:

url     => 'http://www.google.com/',

}

class { ‘cloudinsight_agent::integrations::http_check’:

url     => 'http://localhost/',
headers => ['Host: stan.borbat.com', 'DNT: true'],
tags    => ['production', 'wordpress'],

}

class { ‘cloudinsight_agent::integrations::http_check’:

url                   => 'http://localhost:9001/',
timeout               => 5,
threshold             => 1,
window                => 1,
include_content       => true,
collect_response_time => true,
contact               => 'pagerduty',
tags                  => 'production',

}

Parameters:

  • url (Any) (defaults to: undef)
  • username (Any) (defaults to: undef)
  • password (Any) (defaults to: undef)
  • timeout (Any) (defaults to: 1)
  • threshold (Any) (defaults to: undef)
  • window (Any) (defaults to: undef)
  • include_content (Any) (defaults to: false)
  • collect_response_time (Any) (defaults to: true)
  • disable_ssl_validation (Any) (defaults to: false)
  • headers (Any) (defaults to: [])
  • tags (Any) (defaults to: [])
  • contact (Any) (defaults to: [])


76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'manifests/integrations/http_check.pp', line 76

class cloudinsight_agent::integrations::http_check (
  $url       = undef,
  $username  = undef,
  $password  = undef,
  $timeout   = 1,
  $threshold = undef,
  $window    = undef,
  $include_content = false,
  $collect_response_time = true,
  $disable_ssl_validation = false,
  $headers   = [],
  $tags      = [],
  $contact   = [],
) inherits cloudinsight_agent::params {

  file { "${cloudinsight_agent::params::conf_dir}/http_check.yaml":
    ensure  => file,
    owner   => $cloudinsight_agent::params::cloudinsight_user,
    group   => $cloudinsight_agent::params::cloudinsight_group,
    mode    => '0600',
    content => template('cloudinsight_agent/agent-conf.d/http_check.yaml.erb'),
    require => Package[$cloudinsight_agent::params::package_name],
    notify  => Service[$cloudinsight_agent::params::service_name]
  }
}