diff --git a/manifests/metricbeat.pp b/manifests/metricbeat.pp index deb267f..a154229 100644 --- a/manifests/metricbeat.pp +++ b/manifests/metricbeat.pp @@ -6,6 +6,8 @@ $stats_system = true, $stats_proc = true, $stats_filesystem = true, + $stats_processes = true, + $extra_conf = {}, ){ case $::osfamily { @@ -13,7 +15,7 @@ include ::apt::update package {'metricbeat': ensure => $ensure, - require => Class['apt::update'] + require => Class['apt::update'], } } 'RedHat': { @@ -24,7 +26,7 @@ default: { fail("${::osfamily} not supported yet") } } - include beats::metricbeat::config + include ::beats::metricbeat::config service { 'metricbeat': ensure => running, diff --git a/templates/metricbeat/metricbeat.yml.erb b/templates/metricbeat/metricbeat.yml.erb index f68f94a..ca7f99d 100644 --- a/templates/metricbeat/metricbeat.yml.erb +++ b/templates/metricbeat/metricbeat.yml.erb @@ -40,11 +40,18 @@ metricbeat.modules: # Network stats - network + <%-end-%> + <%- if @stats_processes %> # Per process stats - process + processes: <%= @procs.to_json %> <%-end-%> + enabled: true period: <%= @period %> - processes: <%= @procs.to_json %> - + <%- if @extra_conf %> + <%- @extra_conf.each do |my_key, my_value| %> + <%= my_key %>: <%= my_value.to_json %> + <%- end -%> + <%- end -%>