Giter Site home page Giter Site logo

docker-machine-agent's Introduction

Standalone Machine Agent for Docker Visibility

The following example shows how to build and run the Standalone Machine Agent in a container with Docker Visibility enabled. This is provided as a guide only, and you may freely modify it to suit your needs. Docker Container monitoring requires a Server Visibility license and version 4.3.3 or higher of both the Controller and the Standalone Machine Agent.

To build and run this example, you should be running Docker API version 1.27 or higher (to find out your version, run: docker version). This example uses a Ubuntu 14.04 base image and packages the standalone Machine Agent (with bundled JRE) and a simple Bash shell script that starts the Machine Agent with the correct system properties to connect to your Controller: you supply these values as environment variables via the docker-compose.yml file.

To build and run the project:

  1. Clone this repo and cd docker-machine-agent
  2. Edit the docker-compose.yml file and replace the text in italic with the host, port, account name, access key and SSL connection details for your Controller. Please see the product documentation for details of how to configure these properties, which allow the Machine Agent to connect to your Controller instance.
  3. Download the Machine Agent ZIP bundle with JRE (64-bit Linux) from the AppDynamics Download Site, copy it to your project directory and rename to machine-agent.zip
  4. Run docker-compose up

The first time you run this command, you will see a lot of console output as the Docker image is built, followed by output similar to this:

Starting docker-machine-agent ... 
Starting docker-machine-agent ... done
Attaching to docker-machine-agent
docker-machine-agent    | Using Java Version [1.8.0_111] for Agent
docker-machine-agent    | Using Agent Version [Machine Agent v4.3.3.0 GA Build Date 2017-06-06 19:28:14]
docker-machine-agent    | [INFO] Agent logging directory set to: [/opt/appdynamics/machine-agent]
docker-machine-agent    | Machine Agent Install Directory :/opt/appdynamics/machine-agent
docker-machine-agent    | Machine Agent Temp Directory :/opt/appdynamics/machine-agent/tmp
docker-machine-agent    | Tasks Root Directory :/opt/appdynamics/machine-agent/controlchannel
docker-machine-agent    | [INFO] Agent logging directory set to: [/opt/appdynamics/machine-agent]
docker-machine-agent    | Redirecting all logging statements to the configured logger
docker-machine-agent    | Started AppDynamics Machine Agent Successfully.

Some Useful Commands

  • View the Machine Agent log: docker exec -it docker-machine-agent bash -c "tail -f /opt/appdynamics/machine-agent/logs/machine-agent.log"
  • Stop the container: docker-compose stop
  • Rebuild the container: docker-compose up --build

docker-machine-agent's People

Contributors

mqprichard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-machine-agent's Issues

error while starting machine agent

Hi,
Im getting below error while starting the machine agent in the docker, please help

I cloned the image from https://github.com/Appdynamics/docker-machine-agent

and executed the docker-compose up command after the machine agent installation.

But im getting below error while starting the machine agent, can anyone help please??

"$ docker-compose up
Creating docker-machine-agent ... done
Attaching to docker-machine-agent
docker-machine-agent | /bin/sh: 1: /opt/appdynamics/machine-agent//start-appdynamics: not found
docker-machine-agent exited with code 127"

I dont know what is wrong with this

Issue with Docker-Compose with Docker for Windows

Hi, been attempting to run the compose script for the docker-machine-agent using Docker for Windows (Windows 10), can anyone assist?

For sake of brevity I only added the logs starting with step 3/8:

Logtrace:

Step 3/8 : ENV MACHINE_AGENT_HOME /opt/appdynamics/machine-agent/
---> Running in 66e80ade398b
Removing intermediate container 66e80ade398b
---> dced206a6f31
Step 4/8 : ADD machine-agent.zip /tmp/
---> 98d7ee459302
Step 5/8 : RUN mkdir -p ${MACHINE_AGENT_HOME} && unzip -oq /tmp/machine-agent.zip -d ${MACHINE_AGENT_HOME} && rm /tmp/machine-agent.zip
---> Running in 806ffa746cf2
Removing intermediate container 806ffa746cf2
---> 7aa82fdb7449
Step 6/8 : ADD start-appdynamics ${MACHINE_AGENT_HOME}
---> 3f6a9c5c74fb
Step 7/8 : RUN chmod 744 ${MACHINE_AGENT_HOME}/start-appdynamics
---> Running in c806a8710030
Removing intermediate container c806a8710030
---> 9d72e551ce31
Step 8/8 : CMD "${MACHINE_AGENT_HOME}/start-appdynamics"
---> Running in 474bd559fc33
Removing intermediate container 474bd559fc33
---> 0a0a1ae6660e
Successfully built 0a0a1ae6660e
Successfully tagged appdynamics/docker-machine-agent:latest
WARNING: Image for service docker-machine-agent was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.
Creating docker-machine-agent ... error

ERROR: for docker-machine-agent Cannot create container for service docker-machine-agent: invalid volume specification: '/host_mnt/hostroot:ro'

ERROR: for docker-machine-agent Cannot create container for service docker-machine-agent: invalid volume specification: '/host_mnt/hostroot:ro'
ERROR: Encountered errors while bringing up the project.

Require image for ARM64 architecture

Hi Team,

I am trying to use the appdynamics/machine-agent-analytics image on the arm64 platform but it seems it is not available for arm64.

I have tried building the image on the arm64 platform using docker-compose up command, but it is failing with below error on both amd64 and arm64.

Step 4/8 : ADD machine-agent.zip /tmp/ 
ERROR: Service 'docker-machine-agent' failed to build: ADD failed: file not found in build context or excluded by .dockerignore: stat machine-agent.zip: file does not exist 

In Readme, it is mentioned to download machine-agent.zip from here but while opening the link I am getting authentication issue during login.

It will be very helpful if the image is released for the ARM64 platform. If required, I am happy to contribute. But as a start, can you please provide me with some pointers on the above issue?

start-appdynamics: not found

Hi,

I used docker file and run the container with created image. What could be the issue, I tried compose file also landed in same issue.

[docker@xxxxx appD_agent_compose]$ docker build -t appdynamics/docker-machine-agent:v1 . Sending build context to Docker daemon 167.7MB
Step 1/8 : FROM ubuntu:14.04
14.04: Pulling from library/ubuntu
bae382666908: Pull complete
29ede3c02ff2: Pull complete
da4e69f33106: Pull complete
8d43e5f5d27f: Pull complete
b0de1abb17d6: Pull complete
Digest: sha256:6e3e3f3c5c36a91ba17ea002f63e5607ed6a8c8e5fbbddb31ad3e15638b51ebc
Status: Downloaded newer image for ubuntu:14.04
---> dea1945146b9
Step 2/8 : RUN apt-get update && apt-get upgrade -y && apt-get install -y unzip && apt-get clean
---> Running in 63fa5d47cc11
Ign http://archive.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Get:2 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Get:3 http://security.ubuntu.com trusty-security/universe Sources [76.4 kB]
Get:4 http://archive.ubuntu.com trusty-backports InRelease [65.9 kB]
Get:5 http://archive.ubuntu.com trusty Release.gpg [933 B]
Get:6 http://security.ubuntu.com trusty-security/main amd64 Packages [831 kB]
Get:7 http://archive.ubuntu.com trusty-updates/universe Sources [241 kB]
Get:8 http://security.ubuntu.com trusty-security/restricted amd64 Packages [17.8 kB]
Get:9 http://archive.ubuntu.com trusty-updates/main amd64 Packages [1277 kB]
Get:10 http://security.ubuntu.com trusty-security/universe amd64 Packages [238 kB]
Get:11 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [3997 B]
Get:12 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [21.1 kB]
Get:13 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [552 kB]
Get:14 http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages [15.5 kB]
Get:15 http://archive.ubuntu.com trusty-backports/main amd64 Packages [14.8 kB]
Get:16 http://archive.ubuntu.com trusty-backports/restricted amd64 Packages [40 B]
Get:17 http://archive.ubuntu.com trusty-backports/universe amd64 Packages [52.6 kB]
Get:18 http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages [1396 B]
Get:19 http://archive.ubuntu.com trusty Release [58.5 kB]
Get:20 http://archive.ubuntu.com trusty/universe Sources [7926 kB]
Get:21 http://archive.ubuntu.com trusty/main amd64 Packages [1743 kB]
Get:22 http://archive.ubuntu.com trusty/restricted amd64 Packages [16.0 kB]
Get:23 http://archive.ubuntu.com trusty/universe amd64 Packages [7589 kB]
Get:24 http://archive.ubuntu.com trusty/multiverse amd64 Packages [169 kB]
Fetched 21.0 MB in 39s (537 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
zip
The following NEW packages will be installed:
unzip
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 157 kB of archives.
After this operation, 395 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main unzip amd64 6.0-9ubuntu1.5 [157 kB]
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Fetched 157 kB in 0s (1066 kB/s)
Selecting previously unselected package unzip.
(Reading database ... 11569 files and directories currently installed.)
Preparing to unpack .../unzip_6.0-9ubuntu1.5_amd64.deb ...
Unpacking unzip (6.0-9ubuntu1.5) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Setting up unzip (6.0-9ubuntu1.5) ...
---> 5747d109634d
Removing intermediate container 63fa5d47cc11
Step 3/8 : ENV MACHINE_AGENT_HOME /opt/appdynamics/machine-agent
---> Running in 8591152e8fd5
---> f42f0dff64e9
Removing intermediate container 8591152e8fd5
Step 4/8 : ADD machine-agent.zip /tmp/
---> 7360794ed843
Removing intermediate container f24a229e9fce
Step 5/8 : RUN mkdir -p ${MACHINE_AGENT_HOME} && unzip -oq /tmp/machine-agent.zip -d ${MACHINE_AGENT_HOME} && rm /tmp/machine-agent.zip
---> Running in cc15f8c5d825
---> b73f92ffc120
Removing intermediate container cc15f8c5d825
Step 6/8 : ADD start-appdynamics ${MACHINE_AGENT_HOME}
---> 6a9e45d3bafe
Removing intermediate container 1ec44f823f2c
Step 7/8 : RUN chmod 744 ${MACHINE_AGENT_HOME}/start-appdynamics
---> Running in 2b434e6bf218
---> 0b3f1773ef00
Removing intermediate container 2b434e6bf218
Step 8/8 : CMD "${MACHINE_AGENT_HOME}/start-appdynamics"
---> Running in 5b2b1c0fc297
---> 25d2d6d06a1a
Removing intermediate container 5b2b1c0fc297
Successfully built 25d2d6d06a1a
Successfully tagged appdynamics/docker-machine-agent:v1
[docker@xxxxx appD_agent_compose]$ docker run --rm -it -e APPD_HOST=xxxx.saas.appdynamics.com -e APPD_PORT=443 -e APPD_SSL_ENABLED=true -e APPD_ACCOUNT_NAME=xxxxx -e APPD_ACCESS_KEY=xxxxxx -v /:/hostroot:ro -v /var/run/docker.sock:/var/run/docker.sock appdynamics/docker-machine-agent:v1
/bin/sh: 1: /opt/appdynamics/machine-agent/start-appdynamics: not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.