Last active
July 17, 2023 18:30
-
-
Save andrewmatveychuk/f9eb8444ea28d405adbc386677258d84 to your computer and use it in GitHub Desktop.
Revisions
-
andrewmatveychuk revised this gist
Mar 22, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Configuration datadogConfiguration { #Download location for Datadog Monitoring agent package $datadogAgentPackageLocalPath = "C:\Deploy\datadog-agent-7-latest.amd64.msi" Node localhost { #region Datadog Monitoring agent -
andrewmatveychuk created this gist
Mar 22, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ Configuration datadogConfiguration { #Importing required DSC resources Import-DscResource -ModuleName PSDesiredStateConfiguration Import-DscResource -ModuleName xPSDesiredStateConfiguration #Getting the configuration parameters for deployment $datadogAPIKey = Get-AutomationVariable -Name "datadogAPIKey" $datadogSite = Get-AutomationVariable -Name "datadogSite" #Download location for Datadog Monitoring agent package $datadogAgentPackageLocalPath = "C:\Deploy\datadog-agent-7-latest.amd64.msi" Node $AllNodes.NodeName { #region Datadog Monitoring agent #Download installation file for Datadog Monitoring agent xRemoteFile datadogAgentPackage { Uri = "https://s3.amazonaws.com/ddagent-windows-stable/datadog-agent-7-latest.amd64.msi" DestinationPath = $datadogAgentPackageLocalPath } #Installing Datadog Monitoring agent on a host xPackage datadogAgent { Name = "Datadog Agent" Ensure = "Present" Path = $datadogAgentPackageLocalPath Arguments = "APIKEY=" + $datadogAPIKey + " SITE=" + $datadogSite ProductId = "6AFE2B52-EB1F-4D0D-8C22-E1003ADA1196" DependsOn = "[xRemoteFile]datadogAgentPackage" } #Verifying that the agent service is running xService datadogAgentService { Name = "datadogagent" Ensure = "Present" State = "Running" DependsOn = "[xPackage]datadogAgent" } #Logging the installation in the event log (Microsoft-Windows-Desired State Configuration/Analytic event log) Log datadogAgentInstalled { Message = "Datadog Monitoring Agent has been successfully installed." DependsOn = "[xPackage]datadogAgent" } #endregion } }