Splunk AppDynamics

unable to get it work with tomcat

CommunityUser
Splunk Employee
Splunk Employee

I put below in both tomcat/bin/setenv.sh and tomcat/conf/tomcat.conf

export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/home/centos/appagent/javaagent.jar"

as you see all users were given RW to /home/centos/appagent

drw-rw-rw-. 2 centos centos      64 Nov  6 16:26 conf
-rw-rw-rw-. 1 centos centos   55783 Nov  6 16:25 jackson-annotations-2.8.1.jar
-rw-rw-rw-. 1 centos centos     198 Nov  6 16:26 jackson-annotations-2.8.1.jar.asc
-rw-rw-rw-. 1 centos centos  280014 Nov  6 16:25 jackson-core-2.8.1.jar
-rw-rw-rw-. 1 centos centos     198 Nov  6 16:26 jackson-core-2.8.1.jar.asc
-rw-rw-rw-. 1 centos centos 1230290 Nov  6 16:25 jackson-databind-2.8.1.jar
-rw-rw-rw-. 1 centos centos     198 Nov  6 16:26 jackson-databind-2.8.1.jar.asc
-rw-rw-rw-. 1 centos centos  143973 Nov  6 16:25 javaagent.jar
-rw-rw-rw-. 1 centos centos     198 Nov  6 16:26 javaagent.jar.asc
-rw-rw-rw-. 1 centos centos    3481 Nov  6 16:25 readme.txt
-rw-rw-rw-. 1 centos centos     198 Nov  6 16:26 readme.txt.asc
-rw-rw-rw-. 1 centos centos   27037 Nov  6 16:25 uaruleanalyzer.jar
-rw-rw-rw-. 1 centos centos     198 Nov  6 16:26 uaruleanalyzer.jar.asc
drw-rw-rw-. 9 centos centos    4096 Nov  6 16:26 ver4.4.1.0

any pointers would be helpful.

Thanks!

Andy

Labels (1)
0 Karma

Peter_Holditch
Builder

When you say "unable to get it to work", can you elaborate?

Does tomcat start? 

  1. If not, does it log any errors?
  2. If yes, what does happen?   do you see any agent logs under /home/centos/appagent/ver4.4.1.0/logs?
0 Karma

CommunityUser
Splunk Employee
Splunk Employee
Thanks for responding.

Tomcat starts fine. No logs are seen in ver4.4.1.0/logs folder and sass
dashboard does not show anycontent.
0 Karma

CommunityUser
Splunk Employee
Splunk Employee

How about the arguments for application name, node name and tier name?

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Not sure what that means?

I folloed below instructions..

https://docs.appdynamics.com/display/PRO44/Apache+Tomcat+Startup+Settings

The zip was unzipped to /home/centos/appagent and add below line to /usr/share/tomcat/bin/setenv.sh file .. export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/home/centos/appagent/javaagent.jar"

0 Karma

Peter_Holditch
Builder

if you run "ps -ef" with your tomcat started, do you see the -javaagent option added to the tomcat JVM command string?  Can you post what you see here?

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

If i use jvisualvm to monitor tomcat process I can see jvm arguments

-Djavaagent:C:/ABHIROOP/WORK/POC/appdynamics/appagent/javaagent.jarimage.png

Running ps -ef disclose only one process..

C:\Users\abhiroop.g>ps -ef
UID PID PPID TTY STIME COMMAND
abhiroop 128104 1 cons0 14:55:02 /usr/bin/ps

Still inside appagent\ver4.5.5.24422\logs   nothing appearing none in Dashboard at  

******.saas.appdynamics.com/controller 

0 Karma

Peter_Holditch
Builder

You have the command line option wrong...

You have typed -Djavaagent:C:/ABHIROOT/...

It shoud just be -javaagent:C:/ABHIROOT/...

warm regards,

Peter

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

HI ;

Thanks for quick response as I'm in evaluation subscription. 

SIr ; I'hv used all such permutations [below snapshot for reference] . 

I have used yaml for daemon set creation to monitor my Paas servers and I can see some result at dashboard but once I'm dealing with agents to monitor my tomcat ( executing locally ) , nothing apprearing . 

image.png

0 Karma

Peter_Holditch
Builder

With the -javaagent option corrected, the next step is to look at the agent logs and see what is written in there.

Another trick is to run a simple smoke test: "java -javaagent:<path to agent> -version

If this prints the java version successfully, it will also have started the agent on your machine, which will have written some logs.  These may also contain clues as to what is going on.

Warm regards,

Peter

CommunityUser
Splunk Employee
Splunk Employee

Sir ;

Thank you a lot for your quick responses . Just before I was about to leave it you kept me working .

Any way , I tried to execute version command and it returns below text . At some third party blog I found hint to add -Dappagent.install.dir="C:/ABHIROOP/WORK/POC/appdynamics/appagent" as part of JVM and then on restart application I found such logs started creating and dashboard reflects my applications .

I wish to have docs.appdynamics updated [ i.e. -Dappagent.install.dir is one imp argument]   or may be it is specific case as I use tomcat [ tomcat-9.0.7.B.RELEASE ] server of pivotal implementation in SpringSourceToolSuite.

C:\Users\abhiroop.g>java -javaagent:C:/ABHIROOP/WORK/POC/appdynamics/appagent/javaagent.jar -version
Could not resolve Agent installation directory, please restart with system property appagent.install.dir
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

image.png

Thank YOu : Happy Coding !!!

Peter_Holditch
Builder

I'm delighted you got things working!

The install.dir property should not be mandatory, so I will look in to why that seems to be needed in your case.

I hope you enjoy the rest of your evaluation experience!

Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...