Network Agent version 4.5.7 and Java Agent version 4.5.11 eliminate the need to separately configure the Network Agent in a multi-tenant setup when running multiple nodes on the same machine. If you use the Network Agent version 4.5.7 with Java Agent version 4.5.10 or earlier, you need to configure the Network Agent in a multi-tenant setup. For more details, refer Network Agent and Java Agent Installation Instructions.

Network Agent and Java Agent Installation Instructions

If you are using
then
Network Agent version 4.5.7 or later and Java Agent version 4.5.11 or laterInstall the Network Agent.
Network Agent version 4.5.7 or later and Java Agent version 4.5.10 or earlier

Install the Network Agent in a multi-tenant setup or a single tenant setup.

 

 You do not need to manually enable the netlib parameter during the multi-tenant setup, it is enabled by default.


Network Agent version 4.5.6 or earlier

Install the Network Agent in a multi-tenant setup orsingle tenant setup.

 

You need to manually enable the netlib parameter during the multi-tenant setup.

Java App Agent version 4.4 or earlierUpdate the Java Agent.

Install the Network Agent

If you are using Java Agent version 4.5.13 or higher, you need not manually enable the socket collection. It is enabled automatically. You can skip the first step and proceed with Step 2.

Enable Socket Collection on the App Agent  
  1. Configure the Java App Agent startup command to perform the following tasks, as shown in the example:
    • Enable appdynamics.socket.collection.bci.enable for the Network Agent to map network metrics to application flows
      example:

      java -javaagent:<app_server_agent_home>/javaagent.jar \
      -Dappdynamics.socket.collection.bci.enable=true
  2. The following examples illustrate how editing the agent startup command can differ, depending on the framework of the monitored application. For more information, see the relevant section under Agent Installation by Java Framework and the relevant framework documentation.

    FrameworkExample (App Agent ZIP)
    IBM WebSphere and InfoSphere

    In the WebSphere/InfoSphere UI, navigate to the Java Virtual Machine properties page for the monitored server. Then add javaagent and appdynamics.socket.collection.bci.enable=true as a Generic JVM argument. For example:

    javaagent:/usr/appd/agents/apm/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true
    Apache Tomcat

    Add the full command as a Catalina environment variable in file CATALINA_BASE/bin/setenv.sh (Tomcat 6 and later). For example:

    export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/usr/appd/agents/apm/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true"
    Glassfish

    Add the full command as a -javaagent JVM option in the GlassFish domain. You can add the agent using the asadmin tool. For example: 

    export LD_PRELOAD=/usr/appd/agents/netviz/lib/appd-netlib.so
    glassfish4\bin\asadmin create-jvm-options "-
    javaagent\:/usr/appd/agents/apm/javaagent.jar:-Dappdynamics.socket.collection.bci.enable=true"
    JBoss Standalone

    Add the full command to the standalone.sh file. For example:

    export JAVA_OPTS="$JAVA_OPTS -javaagent:/usr/appd/agents/apm/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true"

    Jetty

    Add the full command to the start.ini config file in the Jetty base directory. For example:

    --exec -javaagent:/usr/appd/agents/apm/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true
  3. To verify that the App Agent is running correctly, enter the following command:
    strings /proc/<app_pid>/environ
Specify the Docker Host Gateway IP on the App Agent

These steps are required only if the App Agent is running in a Docker container outside of the Docker Host network.

  1. Open the following file: <app-agent-install-dir>/<version-number>/external-services/netviz/netviz-service.properties
    (You might need to unzip  external-services/netviz.zip to access this file.)
  2. For the netviz.agent.host.address, specify the Gateway IP of the Docker Host network interface. 
    To determine this IP, run the following command on the Docker host: 
    docker inspect <app_container_name> | grep Gateway 
  3. Restart the App Agent. 
  4. To see if the Docker Host network is connected, run the following command from within the container: 
     curl -k -v <host-network-IP>:3892
    If you receive a response – even if it is 404 Not Found – then the network is connected.
Restart the App (IBM JVM Only)

If the monitored app is running in an IBM JVM, you must restart the app for the Network Agent to detect and monitor any persistent connections.


Multi-Tenant Setup (Multiple Apps on the Agent Host)

If you want the Network Agent to monitor multiple app nodes on the same host, you must do the following steps for each App Agent.

If you are using Network Agent version 4.5.6 or earlier, enable the netlib parameter manually as described in Step 1.


Enable Netlib on the Network Agent

  1. Open the following file in a text editor: <network_agent_home>/conf/agent_config.lua
  2. Edit the enable_netlib parameter as follows:
    npm_config = {
          log_destination = "file",
          log_file = "agent.log",
          debug_log_file = "agent-debug.log",
          disable_filter = 1,
          mode = "Advanced",
          enable_netlib = 1,
          lua_scripts_path = ROOT_DIR .. "/scripts/netagent/lua/",
    } 
Install or Update the App Agent (if needed)

The Network Agent requires version 4.4 or higher of the Java App Server Agent. Update each App Agent that is running an earlier version. See Install the Java Agent.

Extract the NetViz External Services folder on the App Agent
  1. Navigate to the following folder: <app-agent-install-dir>/<version-number>/external-services
  2. If not already extracted, extract the netviz.zip archive so that the ZIP contents are under the following folder: 
        <app-agent-install-dir>/<version-number>/external-services
Preload NetLib and Enable Socket Collection on the App Agent  
  1. In this step, you must configure the Java App Agent startup command to perform two additional tasks, as shown in the following example:
    • Preload the appd-netlib library so the Network Agent can collect network metrics for each individual node (rather than for the entire host)

Enable appdynamics.socket.collection.bci.enable for the Network Agent to map network metrics to application flows
example:
LD_PRELOAD=/<network-agent-home>/lib/appd-netlib.so \
java -javaagent:<app_server_agent_home>/javaagent.jar \
-Dappdynamics.socket.collection.bci.enable=true

The following examples illustrate how editing the agent startup command can differ, depending on the framework of the monitored application. For more information, see the relevant section under Agent Installation by Java Framework and the relevant framework documentation.

FrameworkExample (App Agent ZIP)
IBM WebSphere and InfoSphere

In the WebSphere/InfoSphere UI, navigate to the Java Virtual Machine properties page for the monitored server. Then add javaagent and appdynamics.socket.collection.bci.enable=true as a Generic JVM argument. For example:

javaagent:/usr/appd/agents/apm/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true

You can add LD_PRELOAD as a JVM environment variable. The following example describes how to add an environment variable on a Cognos server using IBM Connections 6.0.0:

    1. Log in to the WebSphere Application Server administrative console of the Cognos server.
    2. Click Servers > Server Types > WebSphere application servers.
    3. Click the cognos_server link.
    4. Click JAVA > Process Management > Process definition > Environment Entries > New to add the following entry:
      LD_PRELOAD=/usr/appd/agents/netviz/lib/appd-netlib.so
Apache Tomcat

Add the full command as a Catalina environment variable in file CATALINA_BASE/bin/setenv.sh (Tomcat 6 and later). For example:

export LD_PRELOAD=/<network-agent-home-directory>/lib/appd-netlib.so

export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/<java-agent-home-directory>/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true"

Glassfish

Add the full command as a -javaagent JVM option in the GlassFish domain. You can add the agent using the asadmin tool. For example: 

export LD_PRELOAD=/<network-agent-home-directory>/lib/appd-netlib.so

glassfish4\bin\asadmin create-jvm-options

"-javaagent\:/<java-agent-home-directory>/javaagent.jar:-Dappdynamics.socket.collection.bci.enable=true"

JBoss Standalone

Add the full command to the standalone.sh file. For example:

export LD_PRELOAD=/<network-agent-home-directory>/lib/appd-netlib.so

JAVA_OPTS="$JAVA_OPTS -

javaagent:/<java-agent-home-directory>/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true"

Jetty

For a standalone Jetty using start.jar:

    1. Add the full command to the start.ini config file in the Jetty base directory. For example:
      exec
      javaagent:/usr/appd/agents/apm/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true
    2. Create a script to start Jetty. For example, startJetty.sh:

      export LD_PRELOAD=/usr/appdynamics/agents/netviz/lib/appd-netlib.so java -jar start.jar

For service with embedded Jetty:

    1. Create a script to start Jetty. For example, startJetty.sh:
      export LD_PRELOAD=/<network-agent-home-directory>/lib/appd-netlib.so
      java -javaagent:/<java-agent-home-directory>/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true -jar <embedded_jetty_jar>



  1. To verify that the App Agent is running correctly, enter the following command:
    strings /proc/<app_pid>/environ
Specify the Docker Host Gateway IP on the App Agent

These steps are required only if the App Agent is running in a Docker container outside of the Docker Host network.

  1. Open the following file: <app-agent-install-dir>/<version-number>/external-services/netviz/netviz-service.properties
    (You might need to unzip  external-services/netviz.zip to access this file.)
  2. For the netviz.agent.host.address, specify the Gateway IP of the Docker Host network interface. 
    To determine this IP, run the following command on the Docker host: 
    docker inspect <app_container_name> | grep Gateway 
  3. Restart the App Agent. 
  4. To see if the Docker Host network is connected, run the following command from within the container: 
     curl -k -v <host-network-IP>:3892
    If you receive a response – even if it is 404 Not Found – then the network is connected.
Restart the App (IBM JVM Only)

If the monitored app is running in an IBM JVM, you must restart the app for the Network Agent to detect and monitor any persistent connections.


Single-Tenant Setup (One App Only on the Agent Host)

If you want the Network Agent to monitor one app node only on the same host, do the following steps.

Install or Update the App Agent (if needed)

Network Visibility requires a Java App Agent (version 4.4 or higher) installed on the same host as the Network Agent. See Install the Java Agent.

Extract the NetViz External Services folder on the App Agent
  1. Navigate to the following folder: <app-agent-install-dir>/<version-number>/external-services
  2. If not already extracted, extract the netviz.zip archive so that the ZIP contents are under the following folder: 
        <app-agent-install-dir>/<version-number>/external-services
Enable Socket Instrumentation

This is required for the agent to map network metrics to application flows.

  1. In the Controller, click the gear icon in the top right () and choose AppDynamics Agents > App Server Agents.
  2. Select the agent in the table and click Configure. The App Server Agent Configuration page appears. 
  3. Select the application, tier, and node in the treeview (left).
  4. Select Use Custom Configuration and then click + (the "plus-sign" button) Create Agent Property.
  5. In the Edit Agent Property dialog box, specify:
    1. Name = socket-enabled
    2. Type = Boolean
    3. Value = true

Specify the Docker Host Gateway IP on the App Agent

These steps are required only if the App Agent is running in a Docker container outside of the Docker Host network.

  1. Open the following file: <app-agent-install-dir>/<version-number>/external-services/netviz/netviz-service.properties
    (You might need to unzip  external-services/netviz.zip to access this file.)
  2. For the netviz.agent.host.address, specify the Gateway IP of the Docker Host network interface. 
    To determine this IP, run the following command on the Docker host: 
    docker inspect <app_container_name> | grep Gateway 
  3. Restart the App Agent. 
  4. To see if the Docker Host network is connected, run the following command from within the container: 
     curl -k -v <host-network-IP>:3892
    If you receive a response – even if it is 404 Not Found – then the network is connected.
Restart the App (IBM JVM Only)

If the monitored app is running in an IBM JVM, you must restart the app for the Network Agent to detect and monitor any persistent connections.