Splunk AppDynamics

Installing Java Agent

CommunityUser
Splunk Employee
Splunk Employee

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

Labels (1)
Tags (1)
0 Karma
1 Solution

Brian_Wheeldon
Contributor

The -javaagent term looks OK, but there is not enough information here to determine what went wrong.

Did you check that the path /tmp/appd/javaagent.jar is correct and javaagent.jar is readable by the user that runs Tomcat?

Did Tomcat start? If so, there should be an error message in the Tomcat logs.

Was the agent started? If so, you'll see messages in the Tomcat startup and agent logs in /tmp/appd/<version>/logs/<nodename>/

Regards,

Brian Wheeldon

View solution in original post

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

/opt/tomcat/apache-tomcat-8.0.30/logs/catalina.out

[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: AgentInstallManager - Agent runtime directory set to [/tmp/appd/ver4.3.1.0]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: AgentInstallManager - Agent node directory set to [Java101Template.localdomain]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - Using Java Agent Version [Server Agent v4.3.1.0 GA #15057 r867530f5c748a55ce75851534ad0942226c06d8b 45-4.3.1.next-analytics]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - Running IBM Java Agent [No]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - Java Agent Directory [/tmp/appd/ver4.3.1.0]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - Java Agent AppAgent directory [/tmp/appd/ver4.3.1.0]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - ####################################################################################
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - Java Agent Directory [/tmp/appd/ver4.3.1.0]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - Java Agent AppAgent directory [/tmp/appd/ver4.3.1.0]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - Using Java Agent Version [Server Agent v4.3.1.0 GA #15057 r867530f5c748a55ce75851534ad0942226c06d8b 45-4.3.1.next-analytics]
[Thread-0] Wed May 31 18:39:28 UTC 2017[INFO]: JavaAgent - All agent classes have been pre-loaded
[Thread-0] Wed May 31 18:39:28 UTC 2017[DEBUG]: JavaAgent - Using Java Version [JAVA_18] for AppDynamics Java Agent
Running obfuscated agent
Started AppDynamics Java Agent Successfully.
[Thread-0] Wed May 31 18:39:35 UTC 2017[INFO]: JavaAgent - Started AppDynamics Java Agent Successfully.
 Started AppDynamics Java Agent Successfully

Is it means the agent works?

Regards

0 Karma

Brian_Wheeldon
Contributor

Yes. 

Started AppDynamics Java Agent Successfully

Indicates that the agent is running and should be collecting metrics from your application.

The agent log files should be present below /tmp/appd/ver4.3.1.0/logs/

You should be able to see the application, tier and Tomcat node in the AppDynamics UI.

Brian

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Brian,

Thank You. The right answer for the firts question was; rights.

Do I see it here at application TAB? i have not seen yet. Can i looking for where is my new mistake? Where?

Wow works the Appd communication? Appdynamics agent is pushing to server?

I believe this configuration is at controller-info.xml file.


I tried to run netstat looking for traffic, but i couldn't see.

image.png

0 Karma

Brian_Wheeldon
Contributor

The agent will report metrics to the Controller.

The Controller will create the application named by the agent if it doesn't exist.

There is a mismatch in the information provided. The Tomcat catalina.out log suggests the agent was started correctly, but the Controller UI does not agree.

Do you see agent logs below /tmp/appd/ver4.3.1.0/logs/ ?

If so, the agent log should indicate the problem. 

If not, then verify that the Tomcat user can write that directory (and also  /tmp/appd/ver4.3.1.0/conf/).

Regards,

Brian Wheeldon

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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

0 Karma

Brian_Wheeldon
Contributor

Hi Narita,

The tomcat user needs to be able to write the $AGENT_HOME/<version>/logs/ and $AGENT_HOME/<version>/conf/ directory.

You can verify that by checking the tomcat user and the permissions on those directories, or you can make those directories writable by all. 

If tomcat, agent, controller all all running on the same host as your user, then permissions is not the problem.

It's most likely that the tomcat startup does not include the agent correctly. Please compare your configuration with the documentation at: https://docs.appdynamics.com/display/PRO43/Apache+Tomcat+Startup+Settings

Regards,

Brian

0 Karma

CommunityUser
Splunk Employee
Splunk Employee
Hi Brian,

This might be a basic question, but what commands would you use in linux
for the same?
0 Karma

Brian_Wheeldon
Contributor

Google: 

"linux find user running process"

"linux who owns folder"

Regards,

Brian Wheeldon

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Brian,

   Thank You, I appreciate your help and support.

 My secound solution was update the controller-info.xml with the correct <controller-host>.

Regards

Tiago

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

HI, 

Tks for answering...

Hi put, Is here soomething wrong?

export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/tmp/appd/javaagent.jar"

after that i restarted the tomcat and my application doesnt works, 

Regards

0 Karma

Brian_Wheeldon
Contributor

The -javaagent term looks OK, but there is not enough information here to determine what went wrong.

Did you check that the path /tmp/appd/javaagent.jar is correct and javaagent.jar is readable by the user that runs Tomcat?

Did Tomcat start? If so, there should be an error message in the Tomcat logs.

Was the agent started? If so, you'll see messages in the Tomcat startup and agent logs in /tmp/appd/<version>/logs/<nodename>/

Regards,

Brian Wheeldon

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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

0 Karma

Brian_Wheeldon
Contributor

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

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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.

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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

0 Karma

Brian_Wheeldon
Contributor
See https://winscp.net/eng/docs/transfer_mode for instructions to transfer files in binary mode in WinSCP.
0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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?

0 Karma

Brian_Wheeldon
Contributor

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

Brian

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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?

0 Karma

Brian_Wheeldon
Contributor

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

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...