-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathapache.pp
More file actions
57 lines (54 loc) · 1.62 KB
/
apache.pp
File metadata and controls
57 lines (54 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Class: datadog_agent::integrations::apache
#
# This class will install the necessary configuration for the apache integration
#
# Parameters:
# $url:
# The URL for apache status URL handled by mod-status.
# Defaults to http://localhost/server-status?auto
# $username:
# $password:
# If your service uses basic authentication, you can optionally
# specify a username and password that will be used in the check.
# Optional.
# $tags
# Optional array of tags
#
# Sample Usage:
#
# include 'datadog_agent::integrations::apache'
#
# OR
#
# class { 'datadog_agent::integrations::apache':
# url => 'http://example.com/server-status?auto',
# username => 'status',
# password => 'hunter1',
# }
#
class datadog_agent::integrations::apache (
$url = 'http://localhost/server-status?auto',
$username = undef,
$password = undef,
$tags = [],
$disable_ssl_validation = false
) inherits datadog_agent::params {
include datadog_agent
validate_string($url)
validate_array($tags)
validate_bool($disable_ssl_validation)
if $::datadog_agent::agent6_enable {
$dst = "${datadog_agent::conf6_dir}/apache.yaml"
} else {
$dst = "${datadog_agent::conf_dir}/apache.yaml"
}
file { $dst:
ensure => file,
owner => $datadog_agent::params::dd_user,
group => $datadog_agent::params::dd_group,
mode => '0600',
content => template('datadog_agent/agent-conf.d/apache.yaml.erb'),
require => Package[$datadog_agent::params::package_name],
notify => Service[$datadog_agent::params::service_name]
}
}