Skip to content

Commit 0f4573d

Browse files
mx-psiburaizu
andauthored
Document Windows NPM setup and make sure it starts (#761)
* Add documentation about Windows NPM setup * Apply suggestions from code review Co-authored-by: Bryce Eadie <bryce.eadie@datadoghq.com> * Add note about previous install * Notify services on system probe file updates * Restart the main Agent instead of the system probe * Apply suggestions from code review Co-authored-by: Bryce Eadie <bryce.eadie@datadoghq.com>
1 parent 2ea3a5b commit 0f4573d

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,20 @@ With the [`ini_setting` module](https://forge.puppet.com/modules/puppetlabs/inif
194194

195195
5. Verify your Puppet data is in Datadog by searching for `sources:puppet` in the [Event Stream][5].
196196

197+
### NPM setup
198+
199+
To enable the Datadog Agent Network Performance Monitoring (NPM) features follow these steps:
200+
201+
1. (Windows only) If the Agent is already installed, uninstall it by passing `win_ensure => absent` to the main class and removing other classes' definitions.
202+
2. (Windows only) Pass the `windows_npm_install` option with value `true` to the `datadog::datadog_agent` class. Remove `win_ensure` if added on previous step.
203+
3. Use the `datadog_agent::system_probe` class to properly create the configuration file:
204+
205+
```conf
206+
class { 'datadog_agent::system_probe':
207+
network_enabled => true,
208+
}
209+
```
210+
197211
### Troubleshooting
198212
199213
You can run the Puppet Agent manually to check for errors in the output:
@@ -281,6 +295,8 @@ These variables can be set in the `datadog_agent` class to control settings in t
281295
| `scrub_args` | A boolean to enable the process cmdline scrubbing (defaults to true). |
282296
| `custom_sensitive_words` | An array to add more words beyond the default ones used by the scrubbing feature (defaults to `[]`). |
283297
| `logs_enabled` | A boolean to enable the logs Agent (defaults to false). |
298+
| `windows_npm_install` | A boolean to enable the Windows NPM driver installation (defaults to false). |
299+
| `win_ensure` | An enum (present/absent) to ensure the presence/absence of the Datadog Agent on Windows (defaults to present) |
284300
| `container_collect_all` | A boolean to enable logs collection for all containers. |
285301
| `agent_extra_options`<sup>1</sup> | A hash to provide additional configuration options (Agent v6 and v7 only). |
286302
| `hostname_extraction_regex`<sup>2</sup> | A regex used to extract the hostname captured group to report the run in Datadog instead of reporting the Puppet nodename, for example:<br>`'^(?<hostname>.*\.datadoghq\.com)(\.i-\w{8}\..*)?$'` |

manifests/init.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@
233233
# $apt_release
234234
# The distribution channel to be used for the APT repo. Eg: 'stable' or 'beta'.
235235
# String. Default: stable
236+
# $windows_npm_install
237+
# (Windows only) Boolean to install the Windows NPM driver.
238+
# To use NPM features it is necessary to enable install through this flag, as well as
239+
# configuring NPM through the datadog::system_probe class.
240+
# Boolean. Default: false
236241
#
237242
# Sample Usage:
238243
#

manifests/system_probe.pp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Class: datadog_agent::system_probe
2+
#
3+
# This class contains the Datadog agent system probe (NPM) configuration.
4+
# On Windows, install the NPM driver by setting 'windows_npm_install'
5+
# to 'true on the datadog_agent class.
6+
#
7+
18
class datadog_agent::system_probe(
29
Boolean $enabled = false,
310
Boolean $network_enabled = false,
@@ -26,13 +33,13 @@
2633
}
2734

2835
if $::operatingsystem == 'Windows' {
29-
3036
file { 'C:/ProgramData/Datadog/system-probe.yaml':
3137
owner => $datadog_agent::params::dd_user,
3238
group => $datadog_agent::params::dd_group,
3339
mode => '0640',
3440
content => template('datadog_agent/system_probe.yaml.erb'),
3541
require => File['C:/ProgramData/Datadog'],
42+
notify => Service[$datadog_agent::params::service_name],
3643
}
3744

3845
} else {

0 commit comments

Comments
 (0)