Puppet Class: prometheus::node_gdnsd

Defined in:
modules/prometheus/manifests/node_gdnsd.pp

Overview

Parameters:

  • ensure (Any) (defaults to: 'present')
  • outfile (Any) (defaults to: '/var/lib/prometheus/node.d/gdnsd.prom')


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
# File 'modules/prometheus/manifests/node_gdnsd.pp', line 11

class prometheus::node_gdnsd (
    $ensure = 'present',
    $outfile = '/var/lib/prometheus/node.d/gdnsd.prom',
) {
    validate_re($outfile, '\.prom$')
    validate_ensure($ensure)

    require_package( [
        'python-prometheus-client',
        'python-requests',
    ] )

    file { '/usr/local/bin/prometheus-gdnsd-stats':
        ensure => file,
        mode   => '0555',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/prometheus/usr/local/bin/prometheus-gdnsd-stats.py',
    }

    # Collect every minute
    cron { 'prometheus_gdnsd_stats':
        ensure  => $ensure,
        user    => 'root',
        command => "/usr/local/bin/prometheus-gdnsd-stats --outfile ${outfile}",
    }
}