Splunk AppDynamics

Init file for Linux

CommunityUser
Splunk Employee
Splunk Employee

I'm using the below script to start the dbagent automatically but it doesn't start the agent. interactively running it produces this error: 

# ./dbagent start

./dbagent: line 21: -Dappdynamics.agent.logging.dir=

#AGENT_OPTIONS=: command not found

 

what should these AGENT_OPTIONS be set to? 

 

#AGENT_OPTIONS="$AGENT_OPTIONS -Dappdynamics.agent.logging.dir=/opt/appd/dbagent/logs"

when I try to set them the script still fails with the same error.

 

my script

#!/bin/bash
#
# Init file for AppDynamics Database Agent
#
# chkconfig: 2345 60 25
# description: database agent for AppDynamics

#CHANGE ME: Set to the Java install directory
JAVA="export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")""

#CHANGE ME: Set to the agent's install directory
AGENT_HOME="/opt/appd/dbagent"
AGENT="$AGENT_HOME/db-agent.jar"

#CHANGE ME: Set to a name that is unique to the Controller - required when a machine agent is
#also running on the same hardware
AGENT_OPTIONS="appdynamics.agent.uniqueHostId='unique host ID'"

# Agent Options
AGENT_OPTIONS=""
#AGENT_OPTIONS="$AGENT_OPTIONS -Dappdynamics.agent.logging.dir="
#AGENT_OPTIONS="$AGENT_OPTIONS -Dmetric.http.listener=true | false
#AGENT_OPTIONS="$AGENT_OPTIONS -Dmetric.http.listener.port=<port>"
#AGENT_OPTIONS="$AGENT_OPTIONS -Dserver.name=<hostname>"


start()
{
nohup $JAVA $AGENT_OPTIONS -Xmx256m -jar $AGENT > /dev/null 2>&1 &
}

stop()
{
ps -opid,cmd |egrep "[0-9]+ $jJAVA.*db-agent" | awk '{print $1}' | xargs --no-run-if-empty kill -9
}

case "$1" in
start)
start
;;

stop)
stop
;;

restart)
stop
start
;;
*)
echo "Usage: $0 start|stop|restart"
esac
Labels (1)
0 Karma

Anka_Thanneeru
Explorer

Hi John,

Please comment and add the AGENT_OPTIONS sections like below.

 # commenting below

AGENT_OPTIONS = ""

# Adding the unique host id of the dbagent installed machine

AGENT_OPTIONS="appdynamics.agent.uniqueHostId='DBAgent-Server-Name'"

You can also add the properties as listed document based on the need.

https://docs.appdynamics.com/display/PRO43/Database+Agent+Configuration+Properties

Save and Now check the behavior.

Regards,

Anka

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...