Defined Type: collectd::plugin::curl_json

Defined in:
manifests/plugin/curl_json.pp

Overview

Parameters:

  • url (Any)
  • instance (Any)
  • keys (Hash)
  • ensure (Any) (defaults to: 'present')
  • host (Any) (defaults to: undef)
  • interval (Any) (defaults to: undef)
  • user (Any) (defaults to: undef)
  • password (Any) (defaults to: undef)
  • digest (Any) (defaults to: undef)
  • verifypeer (Any) (defaults to: undef)
  • verifyhost (Any) (defaults to: undef)
  • cacert (Any) (defaults to: undef)
  • header (Any) (defaults to: undef)
  • post (Any) (defaults to: undef)
  • timeout (Any) (defaults to: undef)
  • order (Any) (defaults to: '10')
  • manage_package (Any) (defaults to: undef)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'manifests/plugin/curl_json.pp', line 2

define collectd::plugin::curl_json (
  $url,
  $instance,
  Hash $keys,
  $ensure         = 'present',
  $host           = undef,
  $interval       = undef,
  $user           = undef,
  $password       = undef,
  $digest         = undef,
  $verifypeer     = undef,
  $verifyhost     = undef,
  $cacert         = undef,
  $header         = undef,
  $post           = undef,
  $timeout        = undef,
  $order          = '10',
  $manage_package = undef,
) {
  include collectd

  $_manage_package = pick($manage_package, $collectd::manage_package)

  if $_manage_package {
    if $facts['os']['family'] == 'Debian' {
      ensure_packages('libyajl2')
    }

    if $facts['os']['family'] == 'RedHat' {
      ensure_packages('collectd-curl_json')
    }
  }

  $conf_dir = $collectd::plugin_conf_dir

  # This is deprecated file naming ensuring old style file removed, and should be removed in next major relese
  file { "${name}.load-deprecated":
    ensure => absent,
    path   => "${conf_dir}/${name}.conf",
  }
  # End deprecation

  file {
    "${name}.load":
      path    => "${conf_dir}/${order}-${name}.conf",
      owner   => $collectd::config_owner,
      group   => $collectd::config_group,
      mode    => $collectd::config_mode,
      content => template('collectd/curl_json.conf.erb'),
      notify  => Service[$collectd::service_name],
  }
}