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

Installing Java Agent

tiagomacul
New Poster

I'm following the 

https://docs.appdynamics.com/display/PRO43/Java+Agent

 

I'm using  CENTOS

 

01. 

<>/controller/#/location=GETTING_STARTED_JAVA&timeRange=last_15_minutes.BEFORE_NOW.-1.-1.15

 

02. JVM i select SUN/Rockit (Is this right?)

 

03. Configure - allready configured is SaaS

 

04. Download

 

05. Install Agent

05.a unzip

05.b Set the value of -javaagent to the path to the Java Agent JAR file.

 

06. 

$TOMCAT_HOME/bin/catalina.sh

 

 

I make some mistake, but how can i find this error?

 

Regards

 

 

 

 

 

22 REPLIES 22

Hi I am having the same issue. 

 

I downloaded the java agent from teh controller. copied to linux vm via winscp.

unzipped the installer.zip in the appd folder

i did all the above as the appd user.

 

Then as tomcat user, i created a setenv.sh file . added export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/home/appdt/javaagent.jar"

and restared the tomcat(catalina.sh start and catalina.sh run)

 

I got an error :

Error opening zip file or JAR manifest missing : /home/appd/javaagent.jar
Error occurred during initialization of VM
agent library failed to init: instrument
Error opening zip file or JAR manifest missing : /home/appd/javaagent.jar
Error occurred during initialization of VM
agent library failed to init: instrument

 

 

i went and as appd user 

chmod 755 javaagent.jar

 

retstarted tomcat agin. No result.

 

No agent success logs

 

Brian.Wheeldon
AppDynamics Team (Retired)

More than a few times, I've seen Unix files corrupted when copied from Windows to Linux via WinSCP. 

If the copy is not explicitely "binary", Unix end-of-iines are converted to Windows end-of-lines and the file won't work.

I'm not saying that's definitely what happened in your case, but the error messages are consistent with that kind of file corruption.

 

Regards,

Brian Wheeldon

Brian Wheeldon, Solution Engineer, NYC




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

is there a solution to this? that is the only i can work on this. copy from a windows machine .

i guess that can be an issue. This is the only way i can copy the bits from a windows server to the linux VM.

 

Also I see that the javaagent.jar and log folders do not show todays date. even after i got the agent install success message after tomcat restart.

Brian.Wheeldon
AppDynamics Team (Retired)
See https://winscp.net/eng/docs/transfer_mode for instructions to transfer files in binary mode in WinSCP.

Brian Wheeldon, Solution Engineer, NYC




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

can i skip winscp all togther and use the linux command scp get and put ?

 

I am uninstalling right now. I will delete the setnev,sh file. delete the zip folder

and restrts the tomcat .

 

and what user do you recommend tp use while installing?

Brian.Wheeldon
AppDynamics Team (Retired)

The best practice is to install the Java Agent as the same user that runs the app server you want to monitor. 

 

Brian

Brian Wheeldon, Solution Engineer, NYC




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

I am confused here. Because my undertsanding was that if we isntall as root , we are not messing with changing permissions for any user. I work in a client env. there are regulations here, the application user( they have the sole rights to restart the JVMs/instances) and the server admins are dofferent team( they have root on app servers, hence they install the agent). Hence we always install as root. What teh advantages of installing as the same user like you suggested?

Hi Brain,

 

How can we verify if tomcat can write to agent logs directory?

 

Im running tomcat, agent, controller all on same host under my user still cant see agent on controller and logs arent been written.

 

Regards

Narita

Brian.Wheeldon
AppDynamics Team (Retired)

You may install the agent as root, but it's not required or recommended.

It's necessary that the application server user can write the $AGENT_HOME/<version>/logs/ and $AGENT_HOME/<version>/conf/ directories. If you install the agent as root and don't make those directories writable by the app server user, then the agent startup will fail.

Doc reference: https://docs.appdynamics.com/display/PRO43/Install+the+Java+Agent

Brian Wheeldon, Solution Engineer, NYC




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