This agent has no pre-defined configuration file included so we need to do the installation and configuration manually. Upload the agent and unpack it into a desired location.
root@HUAPPD001-P1:/app/appdynamics/phpagent# bzip2 -d appdynamics-php-agent-x64-linux-4.4.3.1216.tar.bz2 root@HUAPPD001-P1:/app/appdynamics/phpagent# tar xvf appdynamics-php-agent-x64-linux-4.4.3.1216.tar root@HUAPPD001-P1:/app/appdynamics/phpagent/appdynamics-php-agent-linux_x64# mv * /app/appdynamics/phpagent/ root@HUAPPD001-P1:/app/appdynamics/phpagent/appdynamics-php-agent-linux_x64# cd .. root@HUAPPD001-P1:/app/appdynamics/phpagent# rm -rf appdynamics-php-agent-linux_x64 root@HUAPPD001-P1:/app/appdynamics/phpagent# ls -ltr total 64 -rw-r--r-- 1 root root 2343 máj 5 02:50 Install.txt drwxrwxr-x 9 root root 4096 máj 5 03:00 proxy -rw-r--r-- 1 root root 5062 máj 5 03:00 phpcheck.sh drwxrwxr-x 4 root root 4096 máj 5 03:00 php drwxrwxrwx 2 root root 4096 máj 5 03:00 logs -rw-rw-r-- 1 root root 35 máj 5 03:00 LICENSE.txt -rwxrwxr-x 1 root root 30113 máj 5 03:00 install.sh -rw-r--r-- 1 root root 305 máj 5 03:00 appdynamics_api_header.php
To install the application we will have to call the install.sh command. This command will perform the following:
The following parameters are mandatory – in this order – for the install.sh:
The full syntax looks like this:
./install.sh -a=account-name@account-access-key hostname-of-controller 8090 WordPress_Test_Environment WordPress_Server_Php wp-server
Install script for AppDynamics PHP Agent 4.4.3.0GA.5b071fef580bca60d0ed12ddb96d7be8864f342c Found PHP installation in /usr/bin Detected PHP Version: PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.30-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies PHP version id: 7.0 PHP extensions directory: /usr/lib/php/20151012 PHP ini directory: /etc/php/7.0/cli/conf.d Controller Host: hostname Controller Port: 8090 Application Name: WordPress_Test_Environment Tier Name: WordPress_Server_Php Node Name: wp-server Account Name: account-name Access Key: access-key SSL Enabled: false HTTP Proxy Host: HTTP Proxy Port: HTTP Proxy User: HTTP Proxy Password File: Writing '/app/appdynamics/phpagent/php/conf/appdynamics_agent_log4cxx.xml' Writing '/etc/php/7.0/cli/conf.d/appdynamics_agent.ini' Writing '/app/appdynamics/phpagent/proxy/conf/controller-info.xml' rm -f "/usr/lib/php/20151012/appdynamics_agent.so" ln -s "/app/appdynamics/phpagent/php/modules/appdynamics_agent_php_7.0.so" "/usr/lib/php/20151012/appdynamics_agent.so" Writing '/app/appdynamics/phpagent/proxy/
As you can see above the installer found most of the settings automatically and installed the agent. In our case the location of the php.ini was incorrect so we manually locate the php.ini files by executing:
find / -name php.ini /etc/php/7.0/apache2/php.ini /etc/php/7.0/cli/php.ini
We found 2 php.ini‘s on our system, one of them is responsible for the settings for the client run php scripts and the other one is responsible for the apache webserver run php processes. We want to monitor wordpress and mysql so we need to modify the apache one.
Now we need to generate some traffic for the appdynamics controller. We have created a load plan with the Paessler Web Server Stress Tool and started loading the website heavily.
In a few minutes data starts flowing into the appdynamics application dashboard.
Transactions also show up in the other views.
Database calls are automatically detected and queries are displayed.
]]>We have recently set up a test environment with a PHP/MySQL based test Ubuntu 16.04.4 server. We will now set up monitoring for Linux OS, PHP 7.0 and MySQL.
The first step is downloading the machine agent. Open your Appdynamics console and select the Getting Started Wizard.
Then click the Server button on the What do you want to monitor? screen.
At the next screen check if the connection details are correct then click the click here to download button to acquire the Machine Agent.
Upload the downloaded zip file to your ubuntu server, unpack it to a desired location. This is where you want to run the machine agent from.
Check if the hostname of the appdynamics server is resolvable by simply pinging it, and also check if you can telnet into the port defined in the Configure the Controller step ( above ). The Machine Agent zip should contain the configuration files pre-configured with all the connection details, so in this case we do not have to do this manually. Run the machine agent as root using the following command:
[Your-agent-director]/bin/machine-agent &
root@HUAPPD001-P1:/app/appdynamics/machineagent/bin# ./machine-agent Using java executable at /app/appdynamics/machineagent/jre/bin/java Using Java Version [1.8.0_111] for Agent Using Agent Version [Machine Agent v4.4.3.1214 GA Build Date 2018-04-28 05:12:10] [INFO] Agent logging directory set to: [/app/appdynamics/machineagent] Machine Agent Install Directory :/app/appdynamics/machineagent Machine Agent Temp Directory :/app/appdynamics/machineagent/tmp Tasks Root Directory :/app/appdynamics/machineagent/controlchannel [INFO] Agent logging directory set to: [/app/appdynamics/machineagent] Redirecting all logging statements to the configured logger 15:05:30.460 [system-thread-0] DEBUG com.appdynamics.common.framework.util.EmbeddedModeSecurityManager - Installed 15:05:30.490 [system-thread-0] INFO com.appdynamics.analytics.agent.AnalyticsAgent - Starting analytics agent with arguments [-p, /app/appdynamics/machineagent/monitors/analytics-agent/conf/analytics-agent.properties, -yr, analytics-agent.yml] Started AppDynamics Machine Agent Successfully.
Once the agent is started it should automatically show up on the appdynamics console in the servers section.
Click on the machine’s name to open the detailed OS monitoring dashboard.
If you run into connection errors you can check and change the connection settings in the configuration file:
[Your-agent-director]/conf/controller-info.xml
If you only want to use the machine agent on this server, you can hard wire the Application, Tier and Node details in the contoller-info.xml. Please note that if you use for example the PHP Agent on the same box this might stop the PHP Agent to connect to the controller.
There is no need to create the tiers and nodes manually they will be created on the dashboard automatically. We only added the WordPress_Test_Environment Application before the agent assignment. You will need to add the following to the controller-info.xml configuration file:
<force-agent-registration>true</force-agent-registration> <application-name>WordPress_Test_Environment</application-name> <tier-name>WordPress_Server</tier-name> <node-name>huappd001-p1</node-name>
Change the name of the application, tier and node according to your specifications and restart the agent. Once the agent is restarted navigate into the application and verify if the machine agent has been added successfully.
]]>