Splunk AppDynamics

How can I use appdynamics on aws elastic beanstalk?

CommunityUser
Splunk Employee
Splunk Employee

I can't get a solution to the problem that I get forever "Waiting for Connection..." message in the web panel.

Please help me.

Here now my configuration:

File: .ebextensions/appdynamics.config
commands: 
  01-load-appdynamics-java-agent: 
    command: "sudo curl ... that load the agent zip archive from an distribution server"
  02-unzip-appdynamics-java-agent: 
    command: "sudo unzip -o /var/ad.zip -d /var/appdynamics"
  03-Give-permissions-to-appdyn: 
    command: "sudo chmod -R a+rwx /var/appdynamics"
File: Procfile
web: java -javaagent:/var/appdynamics/ver4.4.3.22593/javaagent.jar -Dappdynamics.force.default.ssl.certificate.validation=false -Dappdynamics.agent.applicationName=SMABEWAPI -Dappdynamics.agent.tierName=SMABEWAPIFRONTED -Dappdynamics.agent.nodeName=SVRONE -Dappdynamics.controller.hostName=test.mydomain.com -jar sma-1.4.0.jar

Thank you for your help.

Sincerely,

Sven

Labels (1)
0 Karma
1 Solution

CommunityUser
Splunk Employee
Splunk Employee

I have a solution that works.

Here my solution:

File: Procfile
web: java -javaagent:/opt/AppDynamics/appagent/javaagent.jar -Dappdynamics.controller.hostName=myhostname -Dappdynamics.controller.port=443 -Dappdynamics.controller.ssl.enabled=true -Dappdynamics.agent.accountName=myaccountname -Dappdynamics.agent.accountAccessKey=myaccesskey -Dappdynamics.agent.applicationName=myappname -Dappdynamics.agent.tierName=my-FRONTED -Dappdynamics.agent.nodeName=mynode -jar sma-1.4.0.jar
File: .ebextensions/appdyn.config
commands: 
  01reset:
    command: "rm -rf /opt/AppDynamics/appagent"
    ignoreErrors: true
  02makedir:
    command: "mkdir -p /opt/AppDynamics/appagent"
  03makedir-tmp:
    command: "mkdir -p /tmp"
  04-load-appdynamics-java-agent: 
    command: "sudo curl -k https://myserver.com/pathtomyzipfile.zip > /tmp/appagent.zip"
  05-unzip-appdynamics-java-agent: 
    command: "sudo unzip -o /tmp/appagent.zip -d /opt/AppDynamics/appagent"
  06-Give-permissions-to-appdyn: 
    command: "sudo chmod -R a+rwx /opt/AppDynamics/appagent"
  07cleanup:
    command: "rm /tmp/appagent.zip"  

I hope that helps for another user the struggle with that.

Greetings,

Sven

View solution in original post

0 Karma

Peter_Holditch
Builder

I suspect your issue is with the curl command.  This is a working EB config that adds the agent to tomcat

files:
    "/tmp/appagent.zip":
        mode: "000444"
        owner: ec2-user
        group: ec2-user
        source: https://packages.appdynamics.com/java/4.4.0.3/AppServerAgent-4.4.0.3.zip
 
# command are executed in alphabetical order
commands:
    01reset:
        command: "rm -rf /opt/AppDynamics/appagent"
        ignoreErrors: true
    02makedir:
        command: "mkdir -p /opt/AppDynamics/appagent"
    03unzip:
        command: "unzip /tmp/appagent.zip"
        cwd: /opt/AppDynamics/appagent
    04perms:
        command: "chown -R tomcat:tomcat appagent"
        cwd: /opt/AppDynamics
    05cleanup:
        command: "rm /tmp/appagent.zip"
 
option_settings:
    - option_name: appdynamics.controller.hostName
      value: <CONTROLLER_HOST>
    - option_name: appdynamics.controller.port
      value: <CONTROLLER_PORT>
    - option_name: appdynamics.controller.ssl.enabled
      value: <true/false>
    - option_name: appdynamics.agent.accountName
      value: <ACCOUNT_NAME>
    - option_name: appdynamics.agent.accountAccessKey
      value: <ACCESS_KEY>
    - option_name: appdynamics.agent.applicationName
      value: <APPLICATION_NAME>
    - option_name: appdynamics.agent.tierName
      value: <TIER_NAME>
    - option_name: appdynamics.agent.nodeName
      value: <NODE_NAME>
    - namespace: aws:elasticbeanstalk:container:tomcat:jvmoptions
      option_name: JVM Options
      value: -javaagent:/opt/AppDynamics/appagent/javaagent.jar

I hope this helps.

Warm regards,

Peter

0 Karma

CommunityUser
Splunk Employee
Splunk Employee
Thank you Peter for your very quick answer.

 

When I execute your script then I get following error:

Command failed on instance. Return code: 1 Output: command 04perms in - FILES-TO-DEPLOY/.ebextensions/appdyn.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

 

What I make false?

 

Hope you have an idea what goes wrong.

 

Greetings,

Sven
0 Karma

CommunityUser
Splunk Employee
Splunk Employee

I have a solution that works.

Here my solution:

File: Procfile
web: java -javaagent:/opt/AppDynamics/appagent/javaagent.jar -Dappdynamics.controller.hostName=myhostname -Dappdynamics.controller.port=443 -Dappdynamics.controller.ssl.enabled=true -Dappdynamics.agent.accountName=myaccountname -Dappdynamics.agent.accountAccessKey=myaccesskey -Dappdynamics.agent.applicationName=myappname -Dappdynamics.agent.tierName=my-FRONTED -Dappdynamics.agent.nodeName=mynode -jar sma-1.4.0.jar
File: .ebextensions/appdyn.config
commands: 
  01reset:
    command: "rm -rf /opt/AppDynamics/appagent"
    ignoreErrors: true
  02makedir:
    command: "mkdir -p /opt/AppDynamics/appagent"
  03makedir-tmp:
    command: "mkdir -p /tmp"
  04-load-appdynamics-java-agent: 
    command: "sudo curl -k https://myserver.com/pathtomyzipfile.zip > /tmp/appagent.zip"
  05-unzip-appdynamics-java-agent: 
    command: "sudo unzip -o /tmp/appagent.zip -d /opt/AppDynamics/appagent"
  06-Give-permissions-to-appdyn: 
    command: "sudo chmod -R a+rwx /opt/AppDynamics/appagent"
  07cleanup:
    command: "rm /tmp/appagent.zip"  

I hope that helps for another user the struggle with that.

Greetings,

Sven

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Thank you Peter for your very quick answer.

When I execute your script then I get following error:

Command failed on instance. Return code: 1 Output: command 04perms in - FILES-TO-DEPLOY/.ebextensions/appdyn.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

What I make false?

Hope you have an idea what goes wrong.

Greetings,

Sven

0 Karma

Peter_Holditch
Builder

Can you share the contents of the /var/log/eb-activity.log file?

Thanks,

Peter

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Peter,

my log have I attached to this message. Thank for your help.

Greetings,

Sven

0 Karma
Get Updates on the Splunk Community!

SOC Modernization: How Automation and Splunk SOAR are Shaping the Next-Gen Security ...

Security automation is no longer a luxury but a necessity. Join us to learn how Splunk ES and SOAR empower ...

Ask It, Fix It: Faster Investigations with AI Assistant in Observability Cloud

  Join us in this Tech Talk and learn about the recently launched AI Assistant in Observability Cloud. With ...

Index This | How many sides does a circle have?

  March 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...