Puppet Class: psick::puppet::foss_server_metrics

Defined in:
manifests/puppet/foss_server_metrics.pp

Overview

class psick::puppet::foss_server_metrics

activates the graphite pushed puppet internal server metrics

Parameters:

  • graphite_server (String)

    this parameter must be set!

  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)


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
# File 'manifests/puppet/foss_server_metrics.pp', line 8

class psick::puppet::foss_server_metrics (
  String $graphite_server,
  Boolean $manage                  = $psick::manage,
  Boolean $noop_manage             = $psick::noop_manage,
  Boolean $noop_value              = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }
    Hocon_setting {
      path   => '/etc/puppetlabs/puppetserver/conf.d/metrics.conf',
      notify => Service['puppetserver'],
    }
    hocon_setting { 'server metrics reporters graphite':
      ensure  => present,
      setting => 'metrics.registries.puppetserver.reporters.graphite.enabled',
      value   => true,
    }
    hocon_setting { 'server metrics graphite host':
      ensure  => present,
      setting => 'metrics.reporters.graphite.host',
      value   => $graphite_server,
    }
    hocon_setting { 'server metrics graphite port':
      ensure  => present,
      setting => 'metrics.reporters.graphite.port',
      value   => 2003,
    }
    hocon_setting { 'server metrics graphite update interval':
      ensure  => present,
      setting => 'metrics.reporters.graphite.update-interval-seconds',
      value   => 5,
    }
  }
}