-
Notifications
You must be signed in to change notification settings - Fork 259
Kafka, Linux_proc_extras, Directory, and many other small fixes or additions #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7a2ed2f
d51e04c
cc806f9
dcd23f2
4a9014d
f863041
1365a25
c3b5b27
628aabf
ebf34de
042d98e
a80a3c1
2a0b013
9df65af
81e1483
00aff32
ec50283
a52a19e
5c24757
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ | |
| # excluded_disk_re => '/dev/sd[e-z]*' | ||
| # } | ||
| class datadog_agent::integrations::disk ( | ||
| $use_mount = 'no', | ||
| $use_mount = false, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is exactly what should've been from day one, and I we'll make sure some of this stuff is fixed in the upcoming major release. Unfortunately this would break manifests for current users. I don't think this was currently broken... if it is, please open an issue and I'll tackle it ASAP in the bugfix release. |
||
| $excluded_filesystems = undef, | ||
| $excluded_disks = undef, | ||
| $excluded_disk_re = undef, | ||
|
|
@@ -42,9 +42,10 @@ | |
| ) inherits datadog_agent::params { | ||
| include datadog_agent | ||
|
|
||
| validate_re($use_mount, '^(no|yes)$', "use_mount should be either 'yes' or 'no'") | ||
| validate_bool($use_mount) | ||
|
|
||
| if $all_partitions { | ||
| validate_re($all_partitions, '^(no|yes)$', "all_partitions should be either 'yes' or 'no'") | ||
| validate_bool($all_partitions) | ||
| } | ||
|
|
||
| if $::datadog_agent::agent6_enable { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Class: datadog_agent::integrations::kafka | ||
| # | ||
| # This class will install the necessary configuration for the kafka | ||
| # integration | ||
| # | ||
| # Parameters: | ||
| # $host: | ||
| # The hostname kafka is running on | ||
| # $port: | ||
| # The port to connect on | ||
| # $user | ||
| # The user for the datadog user | ||
| # $password | ||
| # The password for the datadog user | ||
| # $tags | ||
| # Optional array of tags | ||
| # | ||
| # Sample Usage: | ||
| # | ||
| # class { 'datadog_agent::integrations::kafka' : | ||
| # host => 'localhost', | ||
| # tags => { | ||
| # environment => "production", | ||
| # }, | ||
| # } | ||
| # | ||
| # | ||
| class datadog_agent::integrations::kafka( | ||
| $host = 'localhost', | ||
| $port = 9999, | ||
| $user = undef, | ||
| $password = undef, | ||
| $tags = { kafka => broker }, | ||
| ) inherits datadog_agent::params { | ||
| require ::datadog_agent | ||
| validate_hash($tags) | ||
|
|
||
| file { "${datadog_agent::params::conf_dir}/kafka.yaml": | ||
| ensure => file, | ||
| owner => $datadog_agent::params::dd_user, | ||
| group => $datadog_agent::params::dd_group, | ||
| mode => '0600', | ||
| content => template('datadog_agent/agent-conf.d/kafka.yaml.erb'), | ||
| require => Package[$datadog_agent::params::package_name], | ||
| notify => Service[$datadog_agent::params::service_name], | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Class: datadog_agent::integrations::system_core | ||
| # | ||
| # This class will install the necessary configuration for the CPU cores integration | ||
| # | ||
| # Parameters: | ||
| # | ||
| # tags | ||
| # The (optional) tags to add to the check instance. | ||
| # | ||
| # Sample Usage: | ||
| # | ||
| # class { 'datadog_agent::integrations::linux_proc_extras': | ||
| # tags => [ 'env:production' ], | ||
| # } | ||
|
|
||
| class datadog_agent::integrations::linux_proc_extras( | ||
| $tags = [], | ||
| ) inherits datadog_agent::params { | ||
| include datadog_agent | ||
|
|
||
| file { "${datadog_agent::params::conf_dir}/linux_proc_extras.yaml": | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be |
||
| ensure => file, | ||
| owner => $datadog_agent::params::dd_user, | ||
| group => $datadog_agent::params::dd_group, | ||
| mode => '0600', | ||
| content => template('datadog_agent/agent-conf.d/linux_proc_extras.yaml.erb'), | ||
| require => Package[$datadog_agent::params::package_name], | ||
| notify => Service[$datadog_agent::params::service_name] | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,27 @@ | ||
| init_config: | ||
| ### MANAGED BY PUPPET | ||
| <% | ||
| require 'yaml' | ||
|
|
||
| instances: | ||
| - directory: "<%= @directory %>" | ||
| name: "<%= @tag_name %>" | ||
| pattern: "<%= @pattern %>" | ||
| recursive: <%= @recursive %> | ||
| if RUBY_VERSION < "1.9" | ||
| # Hack to avoid ruby 1.8 always reordering the hashes and | ||
| # changing this template resource at every run | ||
| # See https://github.com/DataDog/puppet-datadog-agent/issues/43 | ||
| # Taken from http://www.dzone.com/snippets/generating-yaml-hashes-sorted | ||
| class Hash | ||
| # Replacing the to_yaml function so it'll serialize hashes sorted (by their keys) | ||
| # | ||
| # Original function is in /usr/lib/ruby/1.8/yaml/rubytypes.rb | ||
| def to_yaml( opts = {} ) | ||
| YAML::quick_emit( object_id, opts ) do |out| | ||
| out.map( taguri, to_yaml_style ) do |map| | ||
| sort.each do |k, v| # <-- here's my addition (the 'sort') | ||
| map.add( k, v ) | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| %> | ||
|
|
||
| <%= {'init_config'=>{}, 'instances'=>@instances}.to_yaml %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't supported in older puppets, so we're going to have to something suboptimal like we do with
haproxyorpostgres. I know, its unfortunate thay we have to prescind of a clean elegant solution like this one to accomodate for older puppets. This sort of thing should become the norm soon.