|
| 1 | +# Class: datadog_agent::integrations::network |
| 2 | +# |
| 3 | +# This class will install the network integration |
| 4 | +# |
| 5 | +# Parameters: |
| 6 | +# $collect_connection_state |
| 7 | +# Enable TCP connection state counts |
| 8 | +# |
| 9 | +# Sample Usage: |
| 10 | +# |
| 11 | +# class { 'datadog_agent::integrations::network' : |
| 12 | +# collect_connection_state => false, |
| 13 | +# excluded_interfaces => [ |
| 14 | +# 'lo0', |
| 15 | +# 'lo', |
| 16 | +# ], |
| 17 | +# excluded_interface_re => [ |
| 18 | +# 'eth1.*' |
| 19 | +# ] |
| 20 | +# combine_connection_states => true |
| 21 | +# } |
| 22 | +# |
| 23 | +# |
| 24 | +class datadog_agent::integrations::network( |
| 25 | + $collect_connection_state = false, |
| 26 | + $excluded_interfaces = ['lo','lo0'], |
| 27 | + $excluded_interface_re = [], |
| 28 | + $combine_connection_states = true, |
| 29 | +) inherits datadog_agent::params { |
| 30 | + include ::datadog_agent |
| 31 | + |
| 32 | + validate_array($excluded_interfaces) |
| 33 | + |
| 34 | + file { "${datadog_agent::params::conf_dir}/network.yaml": |
| 35 | + ensure => file, |
| 36 | + owner => $datadog_agent::params::dd_user, |
| 37 | + group => $datadog_agent::params::dd_group, |
| 38 | + mode => '0600', |
| 39 | + content => template('datadog_agent/agent-conf.d/network.yaml.erb'), |
| 40 | + require => Package[$datadog_agent::params::package_name], |
| 41 | + notify => Service[$datadog_agent::params::service_name], |
| 42 | + } |
| 43 | +} |
0 commit comments