AppD Archive

Example Java main method for -Dappdynamics.agent.startup.hook=<JAR-file>

Ketan_Mistry
New Member

Looking at https://docs.appdynamics.com/display/PRO40/Instrument+JVMs+in+Restricted+Environments

Step 1. Implement a class with Java main method

Can someone send me an example of how the main method would look like?

0 Karma

Arun_Dasetty
Super Champion

Hi , 

You could google it example, this is general https://docs.oracle.com/javase/tutorial/getStarted/application/  and  https://docs.oracle.com/javase/tutorial/deployment/jar/build.html , Hope that is what you are looking for

0 Karma

Ketan_Mistry
New Member

Hmmm, no not what I was looking for. The AppDynamics documentation states:

This "startup hook" allows a single point of deployment for the agent.

I want to understand what this means, and how you do it, if you do not want to specify AppDynamics properties on the JVM command line.

0 Karma

Arun_Dasetty
Super Champion

Hi Ketan,

Say you are starting a standalone jar as referred in attached screenshot initially Or using startup script instead modifying jvm args, you can pass the jar as jvm arg as referred in attached screenshot see if that information helps, agent config parameters like application-name, node-name must be passed under <Agent_dir>/conf/controller-info.xml as well, Can you please confirm if this info helps 

image.png

0 Karma

Ketan_Mistry
New Member

I got this working now.

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...