Puppet Class: prometheus::node_phpfpm_statustext

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

Overview

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')
  • outfile (Pattern[/\.prom$/]) (defaults to: '/var/lib/prometheus/node.d/phpfpm-statustext.prom')
  • php_versions (Array[Wmflib::Php_version]) (defaults to: ['7.2'])


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 'modules/prometheus/manifests/node_phpfpm_statustext.pp', line 16

class prometheus::node_phpfpm_statustext (
    Wmflib::Ensure $ensure = 'present',
    Pattern[/\.prom$/] $outfile = '/var/lib/prometheus/node.d/phpfpm-statustext.prom',
    Array[Wmflib::Php_version] $php_versions = ['7.2'],
) {
    $exec = '/usr/local/bin/prometheus-phpfpm-statustext'
    file { $exec:
        ensure => file,
        mode   => '0555',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/prometheus/usr/local/bin/prometheus-phpfpm-statustext.sh',
    }

    # Collect every minute
    systemd::timer::job { 'prometheus-phpfpm-statustext-textfile':
        ensure          => $ensure,
        description     => 'Update PHP-FPM worker count stats exported by node_exporter',
        command         => "${exec} ${outfile} ${php_versions.join(' ')}",
        user            => 'root',
        logging_enabled => false,
        require         => [File[$exec]],
        interval        => {
            'start'    => 'OnUnitInactiveSec',
            'interval' => '60s',
        },
    }
}