Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion attributes/dotnet_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
default['appdynamics']['dotnet_agent']['checksum'] = '7acb3756147a1d5a13c49b107a890ea56a8eb4099fd793e498e34b6f0b5962dc' #nil
default['appdynamics']['dotnet_agent']['install_dir'] = 'C:\Program Files\Appdynamics'
default['appdynamics']['dotnet_agent']['logfiles_dir'] = 'C:\DotNetAgent\Logs'

default['appdynamics']['dotnet_agent']['Restart_Windows_Service']='AppDynamics.Agent.Coordinator_service'# can be used for restarting any non-instrumented service
default['appdynamics']['dotnet_agent']['template']['cookbook'] = 'appdynamics'
default['appdynamics']['dotnet_agent']['template']['source'] = 'dotnet/setup.config.erb'
default['appdynamics']['dotnet_agent']['standalone_apps'] = {
'w3svc'=>{'executable'=>'b.exe','tier'=>'b Tier','commandline'=>nil,'restart'=>true},
'msdtc'=>{'executable'=>'a.exe','tier'=>'a Tier','commandline'=>'-a -b','restart'=>true}
}

13 changes: 12 additions & 1 deletion recipes/dotnet_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
proxy = node['appdynamics']['http_proxy']
install_directory = agent['install_dir']
system_directory = node['kernel']['os_info']['windows_directory']

agent_msi_path = "#{system_directory}\\Temp"
setup_config = "#{agent_msi_path}\\setup.xml"
install_log_file = "#{agent_msi_path}\\DotnetAgentInstall.log"
Expand Down Expand Up @@ -68,6 +67,7 @@
:controller_accesskey => controller['accesskey'],
:proxy_host => proxy['host'],
:proxy_port => proxy['port'],
:standalone_apps => agent['standalone_apps']
)
end

Expand All @@ -78,3 +78,14 @@
installer_type :msi
only_if { File.exists?(agent_msi) }
end

Restart_Windows_Service = agent['Restart_Windows_Service'] + ',' + agent['standalone_apps'].keys.join(',')

# Restart Appdynamics Agent Coordinator & Windows Services that are instrumented.
# This has to be a separate variable because we are using standalone instrumentation for instrumenting Windows Services
powershell_script 'Restart Windows Services' do
code <<-EOH
Restart-Service #{Restart_Windows_Service}
EOH
not_if Restart_Windows_Service.nil?
end
9 changes: 9 additions & 0 deletions templates/default/dotnet/setup.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
<IIS>
<automatic enabled="true" />
</IIS>
<% unless @standalone_apps.nil? %>
<standalone-applications>
<% @standalone_apps.each { |app_name, app_value| puts %>
<standalone-application executable="<%= app_value[:executable]%>" <% unless app_value[:commandline].nil? %>command-line="<%= app_value[:commandline]%>"<% end %>>
<tier name="<%= app_value[:tier]%>" />
</standalone-application>
<%}%>
</standalone-applications>
<% end %>
</app-agents>
</appdynamics-agent>
</winston>