Install the Network Agent Independent of Machine Agent

You can install and run the Network Agent independently of the Machine Agent using the ZIP, RPM, or DEB installers.

ZIP Network Agent Install

Important Notes

  • If you are using Network Visibility to monitor applications running in Docker containers, you must install the Network Agent in a container as well. See Docker and Network Visibility.
  • To run the install script, log in as root
  • For all other operations, log in as the designated agent administrator (<appd-agent-administrator>) for that host.
  1. Check System Requirements. See Network Visibility Supported Environments.
  2. Download and unzip the Agent installer:

    Login User = Agent Administrator

    1. Log in to the Agent host as <appd-agent-administrator>.
    2. Access the AppDynamics Downloads Portal, download the Network Agent installer, and unzip it.
    3. In a terminal window, cd to the folder where you downloaded the Network Agent ZIP package.
    4. Enter the following command, where <network_agent_home> is the folder where you want to install the agent software:
      unzip <installer.zip> -d <network_agent_home>

      The parent path should not include any directory names with spaces:

      /opt/appdynamics/networkVisibility (correct)

      /opt/appdynamics/network visibility (incorrect)

  3. Install the Agent:

    Login User = root

    1. Log out, and then log in as root.
    2. Go to <network_agent_home> and run the install script:
      cd <network-agent-home>
      ./install.sh
  4. Start and verify the Agent:

    Login User = Agent Administrator

    1. Log out, and then log in as appd-agent-administrator.
    2. Open a CLI window and enter these commands:
      1. <network-agent-home>/bin/start.sh (starts the Agent)
      2. <network-agent-home>/bin/appd-netviz.sh status (verifies that the Agent is running and shows PID of the Agent process)
  5. If you experience any problems or issues, see FAQs for Network Visibility.
  6. If you are installing the Network Agent as part of a Set Up Network Visibility on Linux workflow, proceed to Set Up the Network and App Agents on Linux.

RPM Network Agent Install

Important Note

If you are using Network Visibility to monitor applications running in Docker containers, you must install the Network Agent in a container as well. See Docker and Network Visibility.

  1. Check System Requirements. See Network Visibility Supported Environments.
  2. If you are logged in to the Agent host as a non-root user, log out and then log back in as root.
  3. Access the AppDynamics Downloads Portal and download the Network Agent installer.
  4. Open a terminal window and enter these commands:
    1. sudo rpm -ivh <installer.rpm> (installs the Agent under opt/appdynamics/netviz)
    2. sudo service appd-netviz start (starts the Agent)
    3. sudo service appd-netviz status (verifies that the Agent is running)
  5. If you experience any problems or issues, see FAQs for Network Visibility.
  6. If you are installing the Network Agent as part of a Set Up Network Visibility on Linux workflow, proceed to Set Up the Network and App Agents on Linux.

DEB Network Agent Install

Important Note

If you are using Network Visibility to monitor applications running in Docker containers, you must install the Network Agent in a container as well. See + Docker and Network Visibility.

  1. Check System Requirements. See Network Visibility Supported Environments.
  2. If you are logged in to the Agent host as a non-root user, log out and then log back in as root.
  3. Access the AppDynamics Downloads Portal and download the Network Agent installer.
  4. Open a terminal window and enter the following commands:
    1. sudo dpkg -i <installer.deb> (installs the Agent under opt/appdynamics/netviz)
      (starts the agent, outputs "  appd-netviz start/running. process <pid #>")
    2. sudo service appd-netviz status (verifies the Agent status)
  5. If the Agent does not start, enter:  sudo service appd-netviz start.
  6. If you experience any problems or issues, see FAQs for Network Visibility.
  7. If you are installing the Network Agent as part of a Set Up Network Visibility on Linux workflow, proceed to Set Up the Network and App Agents on Linux.

Install the Network Agent in a Docker Container 

The Network Agent can monitor applications running in Docker containers on the same host. You can deploy one Network Agent per host and collect individual metrics for every local application monitored by a Java App Agent in a container.

AppDynamics recommends that you install the Network Agent in a separate container in Docker Host network mode on the same host as the application containers. This recommendation applies when the App Agent containers are running in Docker Bridge or Docker Host mode.  

Example 1: App Agents in Separate Network
Example 2: App Agents in Host Network

App Agents in Separate Network


App Agents in Host Network

Install the Network Agent and App Agents

  1. Paste the sample Dockerfile into a text file and save the file. This sample Dockerfile contains commands for installing the Network Agent.

    FROM centos:centos7
    
    RUN yum update -y && yum install -y \
      net-tools \
      iproute \
      tcpdump \
      curl  \
      unzip   \
      sysvinit-tools \
      openssh-clients
    
    WORKDIR /netviz-agent
    
    ARG NETVIZ_ZIP_PKG
    
    # copy NetViz agent contents
    ADD ${NETVIZ_ZIP_PKG} .
    
    # run the agent install script
    RUN unzip *.zip && ./install.sh \
        && sed -i -e "s|enable_netlib = 1|enable_netlib = 0|g" ./conf/agent_config.lua \
        && sed -i -e "s|WEBSERVICE_IP=.*|WEBSERVICE_IP=\"0.0.0.0\"|g" ./conf/agent_config.lua
    
    # default command to run for the agent
    CMD  ./bin/appd-netagent -c ./conf -l ./logs -r ./run
    CODE
  2. Navigate to the directory where you saved the Dockerfile. Build the Docker image by entering:

    docker build --build-arg NETVIZ_ZIP_PKG=/path/to/netviz-agent-pkg.zip -t appd-netviz .
    CODE
  3. Push the Docker image to your Docker Trusted Registry.

  4. Deploy your Docker image using this sample Docker Compose file:

    version: '2'
    services:
      appd-netviz-agent:
        image: path/to/your/docker/image # docker registry image
        network_mode: "host"
        restart: unless-stopped 
        ports:
          - '3892:3892'
        cap_add:
          - NET_ADMIN
          - NET_RAW
    CODE

    Alternatively, enter:

    docker run -d --network=host --cap-add=NET_ADMIN --cap-add=NET_RAW path/to/your/netviz/docker/image
    CODE

     

  5. Set up the Network Agent. Follow the single-tenant setup instructions on Set Up the Network and App Agents on Linux.

    For single-tenant setup, you do not need to enable netlib.

Specify the Docker Host Gateway IP on the App Agent

If you are running the App Agent in a Docker container outside of the Docker Host network (as shown in Example 1 in the diagram), complete these steps.

  1. In the host for your App Agent, enter these environment variables:

    export APPDYNAMICS_NETVIZ_AGENT_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
    export APPDYNAMICS_NETVIZ_AGENT_PORT=3892
    CODE
  2. Set the values for the port and host address. Run the application Docker image by passing the AppDynamics environment variables which were exported in Step 1. For example:

    docker run --env "APPDYNAMICS_NETVIZ_AGENT_HOST=$APPDYNAMICS_NETVIZ_AGENT_HOST"
    --env "APPDYNAMICS_NETVIZ_AGENT_PORT=$APPDYNAMICS_NETVIZ_AGENT_PORT" <application_docker_image>
    CODE

Install the Network Agent as an Extension of the Machine Agent (Bundled)

You can install and run the Network Agent as an extension of the Machine Agent (ZIP only) if you want to install both Agents at the same time. 

Important Notes

  • If you are using Network Visibility to monitor applications running in Docker containers, you must install the Network Agent in a container as well. See + Docker and Network Visibility.
  • To run the install script, log in as root
  • For all other operations, log in as the designated agent administrator <appd-agent-administrator> for that host.
  1. Check System Requirements. See Network Visibility Supported Environments.
  2. Download and unzip the Machine Agent:

    Login User = Agent Administrator

    1. Log in to the Agent host as <appd-agent-administrator>.
    2. Access the AppDynamics Downloads Portal, download the Machine Agent installer, and unzip it.
    3. Install the Machine Agent using the Linux ZIP installer as described in the Linux Install Using ZIP with Bundled JRE page. 
  3. Install the Machine Agent and Network Visibility extension:

    Login User = root

    1. Log out and then log in as root.
    2. Open a CLI window and enter:
      1. cd <machine-agent-home>/extensions/NetVizExtension
      2. ./install-extension.sh
  4. Enable the Network Visibility extension and start the Agent:

    Login User = Agent Administrator

    1. Log out and then log in as <appd-agent-administrator>.
    2. Enter the CLI command:
      1. <machine-agent-home>/bin/machine-agent -d -p <machine-agent-home>/pidfile (starts the Machine Agent)
  5. If you experience any problems or issues, see FAQs for Network Visibility.
  6. If you are installing the Network Agent as part of a Set Up Network Visibility on Linux workflow, proceed to Set Up the Network and App Agents on Linux.