question

Haider A. avatar image
Haider A. asked ·

Automation of new agent setup

Hey,

I am looking into automating the setup of the agents on .NET and JAVA clients.
Currently I am using a shell on my windows boxes to install the msi file as such:

msiexec.exe /i dynatrace-agent-4.2.0.3154.msi

So far so good, now I want to add my .net and java processes to the client using command-line options, note that I have done it manually using the interface which doesn't scale with 100s of machines.

Any idea would be appreciated.

10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Andreas G. avatar image
Andreas G. answered ·

For .NET you could do the following
a) configure one machine using the .NET Agent configuration Tool
b) export the registry entries that the .NET Config Tool writes -> look at HKLM\Software\Wow6432Node\dynaTrace\Agent\WhiteList
c) import these registry keys on your other .NET Servers

Andi

2 comments Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Thanks Andi for the reply, that's exactly what I was looking for.
Put it together in a quick shell script below for future references,

Running this script you will need 2 files,

  • production_servers.list (should have list of your servers - one server per line)
  • exported.reg (The manually exported registry file)
install_agent.sh
#!/bin/bash

for server in `cat production_servers.list`
  do 
	scp -r dynatrace-agent-4.2.0.3154.msi exported.reg $server:
	echo "installing"
	ssh $server "msiexec.exe /i dynatrace-agent-4.2.0.3154.msi"
	echo "Agent is installed"
	ssh $server "regedit.exe /S exported.reg"
	echo "Registry changes are done for $server"
	echo "Restarting IIS"
	ssh $server "iisreset.exe /restart"
done
0 Likes 0 · ·

nice - thanks for the script!
happy deploying (smile)

0 Likes 0 · ·
Derek A. avatar image
Derek A. answered ·

Perhaps the REST Interface might be able to help?

You certainly don't have to add an agent via the dT client. On the application server you can add the agent mapping details directly into the JVM options of a java based application such as a Tomcat application or launch the .net configuration editor and add a .net app that way.

As far as "automating" it through a command line, some java applications like a Tomcat application probably have their JVM options stored in the registry which you could manipulate via the command line. It doesn't look like the .net configuration editor has any additonal parameters associated with the dtagentconf.exe. Perhaps it would be a good feature enhancement?

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.