Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not a customer? Start a free trial

Click the Start a free trial link to start a 15-day SaaS trial of our product and join our community as a trial user. If you are an existing customer do not start a free trial.

AppDynamics customers and established members should click the sign in button to authenticate.

Java (Java Agent, Installation, JVM, and Controller Installation)

Multiple application configuration with single java agent, Migrate to Linux


Multiple application configuration with single java agent, Migrate to Linux

Hi all,


We are currently migrating several java applications from from Windows hosts to RHEL so we are trying to match the source configuration as close as possible.


The issue is that we have 2 applications per machine, and the convention is to have spaces in the application name, so the following things are true:

  • Passing spaces in as jvm args doesn't seem to work with the application config, although you would assume that using quotes around the key-value pair, or just the value would work. This was not a problem with the args in the Windows registry
  • I can use spaces in the controller-info.xml however I'm still yet to figure out how we can have 2 separate configurations with the xml files.

So, my questions become:

  • Is there a way for appd to handle spaces in the JVM arguments to define applicationname/teir/nodename etc?
  • If not, how can I handle multiple configurations with 2 JVMs reporting to the same agent?




Tags (3)
By replying you agree to the Terms and Conditions of the AppDynamics Community.
Multiple application configuration with single java agent, Migrate to Linux

Hi There


We have done 100's of Linux servers using spaces in Application Name, Tier & Node Name in the JVM startup parameters. So it does work.


Can you provide your Startup arguments how you are adding them in?



Learn more about me in the Community Member Spotlight Q & A

Thanks for your response. 


That's interesting, and obviously points to a potential issue elsewhere..


In the current setup, there is an input file where we put our args, but there is a script that runs over the top of it to distribute the input properties to their respective settings files.. I suspect this may be where the issue is coming from now that you say it works..


what I have tried was the following:

-javaagent:/opt/Folder/AnotherFolder/javaagent.jar -Dappdynamics.agent.tierName="VALUE WITH SPACES"

-javaagent:/opt/Folder/AnotherFolder/javaagent.jar -Dappdynamics.agent.tierName='VALUE WITH SPACES'

Both single and double quotes. I even tried wrapping the whole argument in quotes but no luck either..


So, failing the ability to fix this script that distributes settings, which I have no control over since it's a COTS thing, Is there a way to use multiple xml files, or even multiple <controller-info> objects in a single xml file?




What I suggest is the following.


Not sure which off the shelf product you are instrumenting, but we have had some Java applications, which due to the way their startup files worked did not like having more than one JVM param added together on the same line, one after the other. So you can append them like below using JAVA_OPTS or similar in your application.


The main problem is the syntax

You need to use single quotes inside of the double quotes as below, where there is a space in the app/tier/node name


I don't have the rest of how you are adding your code, if you re using JAVA_OPTS etc.


In JAVA_OPTS you would basically append the variables one at a time

JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/Folder/AnotherFolder/javaagent.jar"

JAVA_OPTS="$JAVA_OPTS -Dappdynamics.agent.tierName='VALUE WITH SPACES'"


Once you startup the application, do a ps aux | grep command to see the application startup parameters, which will shows you where it's cutting of your arguments, and assist in fixing your problem.







Learn more about me in the Community Member Spotlight Q & A