Preload NetLib and Enable Socket Collection on the App Agent

You must configure the Java App Agent startup command to perform two additional tasks, as shown in the following:
  1. Preload the appd-netlib library so the Network Agent can collect network metrics for each individual node (rather than for the entire host).
  2. Enable appdynamics.socket.collection.bci.enable for the Network Agent to map network metrics to application flows.
    For 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. See Agent Installation by Java Framework and its 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. This 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 this entry: LD_PRELOAD=/usr/appd/agents/netviz/lib/appd-netlib.so
  1. In the WebSphere/InfoSphere UI, navigate to the Java Virtual Machine properties page for the monitored server.
  2. 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 system environment variable. This 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. Go to Servers > Server Types > WebSphere Application Servers.
  3. Click cognos_server.
  4. Go to Java > Process Management > Process Definition > Environment Entries > New to add this 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:execjavaagent:/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.sojava -javaagent:/<java-agent-home-directory>/javaagent.jar -Dappdynamics.socket.collection.bci.enable=true -jar <embedded_jetty_jar>

To verify that the App Agent is running correctly, enter:strings /proc/<app_pid>/environ