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')
  • service (Systemd::Servicename) (defaults to: 'php7.2-fpm.service')


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
# 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',
    Systemd::Servicename $service = 'php7.2-fpm.service',
) {
    $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} ${service} ${outfile}",
        user               => 'root',
        logging_enabled    => false,
        monitoring_enabled => false,
        require            => [File[$exec]],
        interval           => {
            'start'    => 'OnUnitInactiveSec',
            'interval' => '60s',
        },
    }
}