Puppet Class: datadog_agent::integrations::php_fpm

Inherits:
datadog_agent::params
Defined in:
manifests/integrations/php_fpm.pp

Summary

Overview

This class will set-up PHP FPM monitoring

See the sample php_fpm.d/conf.yaml for all available configuration options github.com/DataDog/integrations-core/blob/master/php_fpm/datadog_checks/php_fpm/data/conf.yaml.example

Examples:


class { 'datadog_agent::integrations::php_fpm' :
  status_url     => 'http://localhost/fpm_status',
  ping_url       => 'http://localhost/fpm_ping'
}

Parameters:

  • status_url (String) (defaults to: 'http://localhost/status')

    URL to fetch FPM metrics. Default: localhost/status

  • ping_url (String) (defaults to: 'http://localhost/ping')

    URL to get a reliable check of the FPM pool. Default: localhost/ping

  • ping_reply (String) (defaults to: 'pong')

    Expected response from ping_url. Default: pong

  • tags (Array) (defaults to: [])

    Optional array of tags

  • use_fastcgi (String) (defaults to: 'false')

    Use fastcgi to get stats. Default: false

  • http_host (Optional[String]) (defaults to: undef)
  • instances (Optional[Array]) (defaults to: undef)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'manifests/integrations/php_fpm.pp', line 30

class datadog_agent::integrations::php_fpm (
  String $status_url          = 'http://localhost/status',
  String $ping_url            = 'http://localhost/ping',
  String $ping_reply          = 'pong',
  Optional[String] $http_host = undef,
  Array $tags                 = [],
  Optional[Array] $instances  = undef,
  String $use_fastcgi         = 'false'
) inherits datadog_agent::params {
  require datadog_agent

  if !$instances {
    $_instances = [{
        'http_host'   => $http_host,
        'status_url'  => $status_url,
        'ping_url'    => $ping_url,
        'ping_reply'  => $ping_reply,
        'tags'        => $tags,
        'use_fastcgi' => $use_fastcgi,
    }]
  } else {
    $_instances = $instances
  }

  $dst_dir = "${datadog_agent::params::conf_dir}/php_fpm.d"

  file { $dst_dir:
    ensure  => directory,
    owner   => $datadog_agent::dd_user,
    group   => $datadog_agent::params::dd_group,
    mode    => $datadog_agent::params::permissions_directory,
    require => Package[$datadog_agent::params::package_name],
    notify  => Service[$datadog_agent::params::service_name],
  }
  $dst = "${dst_dir}/conf.yaml"

  file { $dst:
    ensure  => file,
    owner   => $datadog_agent::dd_user,
    group   => $datadog_agent::params::dd_group,
    mode    => $datadog_agent::params::permissions_protected_file,
    content => template('datadog_agent/agent-conf.d/php_fpm.yaml.erb'),
    require => Package[$datadog_agent::params::package_name],
    notify  => Service[$datadog_agent::params::service_name],
  }
}