cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multiple application configuration with single java agent, Migrate to Linux

David.Jones
Creator

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?

Thanks.

 

 

3 REPLIES 3

Mario.Morelli
Architect

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?

 

Ciao



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

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?

Hi 

 

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.

 

 

 

 

 

 



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

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