Puppet Class: datadog_agent::integrations::ntp

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

Overview

Class: datadog_agent::integrations::ntp

This class will enable ntp check

See the sample ntp.d/conf.yaml for all available configuration options github.com/DataDog/datadog-agent/blob/main/cmd/agent/dist/conf.d/ntp.d/conf.yaml.default

Parameters:

$offset_threshold:
     Offset threshold for a critical alert. Defaults to 600.

$host:
     ntp server to use for ntp check

$port

$version

$timeout

Sample Usage:

class { 'datadog_agent::integrations::ntp' :
  offset_threshold     => 60,
  host                 => 'pool.ntp.org',
}

Parameters:

  • offset_threshold (Integer) (defaults to: 60)
  • host (Optional[String]) (defaults to: undef)
  • port (Optional[Integer]) (defaults to: undef)
  • version (Optional[String]) (defaults to: undef)
  • timeout (Optional[Integer]) (defaults to: undef)


28
29
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
# File 'manifests/integrations/ntp.pp', line 28

class datadog_agent::integrations::ntp (
  Integer $offset_threshold  = 60,
  Optional[String] $host     = undef,
  Optional[Integer] $port    = undef,
  Optional[String] $version  = undef,
  Optional[Integer] $timeout = undef,
) inherits datadog_agent::params {
  require datadog_agent

  $dst_dir = "${datadog_agent::params::conf_dir}/ntp.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/ntp.yaml.erb'),
    require => Package[$datadog_agent::params::package_name],
    notify  => Service[$datadog_agent::params::service_name],
  }
}