Skip to content

Instantly share code, notes, and snippets.

@collin-sanford
Last active November 20, 2024 20:27
Show Gist options
  • Save collin-sanford/1a7c484a65573b46e6dc468687a2ea99 to your computer and use it in GitHub Desktop.
Save collin-sanford/1a7c484a65573b46e6dc468687a2ea99 to your computer and use it in GitHub Desktop.
Powershell Install Datadog Agent
# Download and install the Datadog agent
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
$env:DD_API_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$env:DD_SITE = 'datadoghq.com';
$env:DD_REMOTE_UPDATES = 'true';
#$env:DD_AGENT_MAJOR_VERSION = '7';
#$env:DD_AGENT_MINOR_VERSION = '59.0';
iex ((New-Object System.Net.WebClient).DownloadString('https://s3.amazonaws.com/dd-agent-mstesting/Install-Datadog.ps1'));
# Enable logs and live process
((Get-Content -path C:\ProgramData\Datadog\datadog.yaml -Raw) -replace '# logs_enabled: false','logs_enabled: true') | Set-Content -Path C:\ProgramData\Datadog\datadog.yaml
(Add-Content C:\ProgramData\Datadog\datadog.yaml "`nprocess_config:`n enabled: true" )
# Configure win32_event_log
echo "init_config:
instances:
- type:
- Information
- Critical
- Error
- Warning
- Audit Failure
- Audit Success
log_file:
- Application
- System
- Security
- Application
- Setup
logs:
- type: windows_event
channel_path: Application
source: Application
service: Application
sourcecategory: windowsevent
- type: windows_event
channel_path: Security
source: Security
service: Security
sourcecategory: windowsevent
- type: windows_event
channel_path: System
source: System
service: System
sourcecategory: windowsevent
- type: windows_event
channel_path: Setup
source: Setup
service: Setup
sourcecategory: windowsevent" > C:\ProgramData\Datadog\conf.d\win32_event_log.d\conf.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment