-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Leif Eric Hintzsche edited this page Aug 27, 2020
·
16 revisions
The playbooks and the roles provide a sample application that can be instrumented using AppDynamics. The instrumentation can be done manually or via playbooks. For a manual instrumentation, you deploy the supercars application without AppDynamics.
For the instrumentation, you can use an AppDynamics trial account:
This Wiki assumes that you are using CentOS7 as operating system.
sudo yum install unzip vim nmap
sudo yum update -y nss curl libcurl
sudo useradd appd
sudo groupadd appd
sudo usermod -a -G appd appd
sudo usermod -a -G appd tomcat
sudo usermod -a -G appd root
sudo mkdir -p /opt/appd/machine_agent
sudo mkdir -p /opt/appd/java_agent
sudo mkdir -p /opt/appd/db_agent
You will need and appdynamics account in order to access the webpage
Further, you might need to adjust the agent version in the statements below. Just go on the download portal, select the respective agent and copy the link. The link can be used in the following curl statements
TOKEN=\`curl -X POST -d '{"username": "USER","password": "PWD","scopes": ["download"]}' https://identity.msrv.saas.appdynamics.com/v2.0/oauth/token | sed s/\\"/\\|/g | awk 'BEGIN{FS="|"}{print $10}'\`
curl -L -O -H "Authorization: Bearer $TOKEN" "https://download.appdynamics.com/download/prox/download-file/machine-bundle/4.5.16.2357/machineagent-bundle-64bit-linux-4.5.16.2357.zip"
curl -L -O -H "Authorization: Bearer $TOKEN" "https://download.appdynamics.com/download/prox/download-file/sun-jvm/4.5.16.28759/AppServerAgent-4.5.16.28759.zip"
curl -L -O -H "Authorization: Bearer $TOKEN" "https://download.appdynamics.com/download/prox/download-file/db-agent/4.5.5.985/db-agent-4.5.5.985.zip"
sudo unzip machineagent-bundle-64bit-linux-4.5.16.2357.zip -d /opt/appd/machine_agent
sudo unzip AppServerAgent-4.5.16.28759.zip -d /opt/appd/java_agent
sudo unzip db-agent-4.5.5.985.zip -d /opt/appd/db_agent
sudo chown -R appd:appd /opt/appd/
sudo chmod -R u=rwx,g=rwx,o=rx /opt/appd/
sudo su - tomcat
cd /opt/tomcat/apache-tomcat-8.0.30/bin/
./catalina.sh start
- Test the access to the tomcat server http://IP:8080/Cars_Sample_App/angular/index.html#/
sudo su -
touch /opt/tomcat/apache-tomcat-8.0.30/bin/setenv.sh
chmod +x /opt/tomcat/apache-tomcat-8.0.30/bin/setenv.sh
chown tomcat /opt/tomcat/apache-tomcat-8.0.30/bin/setenv.sh
chgrp tomcat /opt/tomcat/apache-tomcat-8.0.30/bin/setenv.sh
echo 'export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/appd/java_agent/javaagent.jar -Dappdynamics.agent.uniqueHostId=RAVELLO_VM"' \> /opt/tomcat/apache-tomcat-8.0.30/bin/setenv.sh
sudo vim /opt/appd/java_agent/conf/controller-info.xml
- set <controller-host>ACCOUNT.saas.appdynamics.com</controller-host> (see controller DNS)
- set <controller-port>443</controller-port>
- set <controller-ssl-enabled>true</controller-ssl-enabled>
- set <application-name>APPNAME</application-name>
- set <tier-name>TOMCAT</tier-name>
- set <node-name>RAVELLO</node-name>
- set <account-name>ACCOUNT</account-name> (see Settings->License->Top-Tab: Account -> Name)
- set <account-access-key>KEY</account-access-key> (see Settings->License->Top-Tab: Account -> Access Key)
sudo su - tomcat
cd /opt/tomcat/apache-tomcat-8.0.30/bin/
./catalina.sh stop
./catalina.sh run (to see if the agent starts correctly, if not check setenv.sh)
./catalina.sh stop
./catalina.sh start
grep AppDynamics /opt/tomcat/apache-tomcat-8.0.30/logs/catalina.out (output: Started AppDynamics Java Agent Successfully)
vi /opt/appd/java_agent/ver4.5.16.28759/logs/RAVELLO/agent.*.log
- Check Top-Tab: Applications, Side-Tab: Tiers and Nodes (agent must pop-up even w/o traffic)
- Check Setting: AppDynamics Agents, App Server Agent (find your unique host-id)
- Generate traffic by clicking around in the application http://IP:8080/Cars_Sample_App/angular/index.html#/
- Check Top-Tab: applications, Side-Tab Application Dashboard (compare Flow-Map)
sudo vim /opt/appd/machine_agent/conf/controller-info.xml
- set <controller-host>ACCOUNT.saas.appdynamics.com</controller-host> (see controller DNS)
- set <controller-port>443</controller-port>
- set <controller-ssl-enabled>true</controller-ssl-enabled>
- set <unique-host-id>RAVELLO_VM</unique-host-id>
- set <account-access-key>KEY</account-access-key> (see Settings->License->Top-Tab: Account -> Access Key)
- set <account-name>ACCOUNT</account-name> (see Settings->License->Top-Tab: Account -> Name)
- set <application-name>APPNAME</application-name>
- set <account-name>ACCOUNT</account-name> (see Settings->License->Top-Tab: Account -> Name)
- set <sim-enabled>true (enable for server visibility)
- set <machine-path>RAVELLO|TOMCAT_VM</machine-path>
sudo su -
cp /opt/appd/machine_agent/etc/sysconfig/appdynamics-machine-agent /opt/appd/machine_agent/etc/sysconfig/appdynamics-machine-agent.cp
cat /opt/appd/machine_agent/etc/sysconfig/appdynamics-machine-agent.cp | sed 's|/appdynamics/|/appd/|g' | sed 's|/machine-agent|/machine_agent|g' | sed 's|appdynamics-machine-agent|appd|g' > /opt/appd/machine_agent/etc/sysconfig/appdynamics-machine-agent
ln -s /opt/appd/machine_agent/etc/sysconfig/appdynamics-machine-agent /etc/sysconfig/appdynamics-machine-agent
cp /opt/appd/machine_agent/etc/init.d/appdynamics-machine-agent /etc/init.d/appdynamics-machine-agent
chkconfig --add appdynamics-machine-agent
service appdynamics-machine-agent start
check machine agent under Top-Tab: Applications, Side-Tab Server
check Setting: AppDynamics Agents, Machine Agents (find your unique host-id)
check Server Visibility is set to yes
check running processes ps -aux | grep appd | vi -
cd /opt/appd/machine_agent/extensions/NetVizExtension/agent/conf
sudo vim agent_config.lua
- change to UNIQUE_HOST_ID = "RAVELLO_VM"
cd /opt/appd/machine_agent/extensions/NetVizExtension/
sudo ./install-extension.sh
service appdynamics-machine-agent restart
sudo vi /opt/appd/machine_agent/monitors/analytics-agent/monitor.xml
set <enabled>true</enabled>
sudo vi /opt/appd/machine_agent/monitors/analytics-agent/conf/analytics-agent.properties
- appdynamics.agent.uniqueHostId=RAVELLO_VM
- ad.controller.url='https://ACCOUNT.saas.appdynamics.com'
- http.event.endpoint='https://fra-ana-api.saas.appdynamics.com:443'
- http.event.name=ACCOUNT
- http.event.accountName=ACCOUNT_5a9b9754-9f17-4528-af7f-5c99b05af7e9
- http.event.accessKey=6gxy3yi7pg0l
service appdynamics-machine-agent restart
debug service appdynamics-machine-agent restart
- activate analytics Analytics -> Configuration -> select App -> select transactions -> save
- check that the analtyics agent is running
curl http://localhost:9091/healthcheck?pretty=true
cd /opt/appd/db_agent/
sudo vim /opt/appd/db_agent/conf/controller-info.xml
- set <controller-host>ACCOUNT.saas.appdynamics.com</controller-host> (see controller DNS)
- set <controller-port>443</controller-port>
- set <controller-ssl-enabled>true</controller-ssl-enabled>
- set <account-name>ACCOUNT</account-name> (see Settings->License->Top-Tab: Account -> Name)
- set <account-access-key>KEY</account-access-key> (see Settings->License->Top-Tab: Account -> Access Key)
sudo ./start-dbagent -Dappdynamics.agent.uniqueHostId=RAVELLO_VM &
mysql -u root -p (password=AppDynamics)
CREATE USER 'DBUSER'@'localhost' IDENTIFIED BY 'DBUSER'; (access from localhost)
CREATE USER 'DBUSER'@'%' IDENTIFIED BY 'DBUSER'; (access from all remote IPs)
GRANT SELECT,PROCESS,SHOW DATABASES on \*.\* to 'DBUSER'@'localhost' identified by 'DBUSER';
GRANT SELECT,PROCESS,SHOW DATABASES on \*.\* to 'DBUSER'@'%' identified by 'DBUSER';
GRANT REPLICATION CLIENT ON \*.\* to 'DBUSER'@'localhost';
GRANT REPLICATION CLIENT ON \*.\* to 'DBUSER'@'%';
FLUSH PRIVILEGES;
EXIT;
sudo service iptables stop (stop firewall on VM or open specific port 3306)
test connection with SQL client (e.g. DBeaver, SQuirreL) and nmap -p 3306 IP
sudo useradd dbuser
sudo passwd dbuser
sudo vim /etc/ssh/sshd_config
set PasswordAuthentication yes
unset PasswordAuthentication no (e.g. use comment)
sudo vim /etc/ssh/ssh_config
set PasswordAuthentication yes
service sshd restart
- Top-Tab: Databases, Side-Tab: Configuration -> add
- Set Database Type = MySQL
- Set Hostname = localhost or IP
- Set Name = Supercars
- Set Listener Port= 3306
- Set Username = DBUSER (user on SQL server)
- Set Password = DBUSER (password for SQL server)
- Check Logging
- Check Monitor Operating System
- Set Operating System = LINUX
- Set SSH Port = 22
- Set Username = dbuser (user on linux machine)
- Set Password = dbuser (user on linux machine)
- sudo vim /opt/appd/db_agent/logs/agent.log (check logs)