Versions Compared

    Key

    • This line was added.
    • This line was removed.
    • Formatting was changed.
    Comment: Published by Scroll Versions from this space and version 20.6
    Sv translation
    languageen
    Appd tocbox

    Related pages:

    The Java Agent can accept configuration settings specified as system properties. This is useful when you have more than one JVM running on a machine and need to set node properties dynamically.

    The JVMs may be in the same tier or on different tiers in the AppDynamics model. In either case:

    • All of the common information should be configured using controller-info.xml.
    • All of the information unique to a JVM should be configured using the system properties (-D option) in the startup script.
    • Information in the startup scripts always overrides the information in the controller-info.xml file.

    Java Agent Configuration Properties describes the system properties available for the Java Agent.

    Referencing System Properties

    You can reference system properties from the command line or in the agent configuration file to specify the node name, tier name, or other agent configuration properties dynamically. 

    For example, consider an a Java application started with a script named startserver.sh. The script defines a system property as follows:

    Code Block
    -Dserver.name=$1
    

    The property server.name will get the value of the first argument passed when starting the script. For example, the following command to start the JVM would bind the server server.name property to the value ecommerce01:

    Code Block
    startserver.sh ecommerce01

    You can use this value in your agent configuration by setting the -Dappdynamics.agent.nodeName property at startup as follows.

    Code Block
    -Dappdynamics.agent.nodeName=$server.name
    

    Or, you can use the value in the controllerthe controller-info.xml file, using the following format: 

    Code Block
    ${system_property_name}

    For example:

    Code Block
    <controller-info>
        ...
        <node-name>${server.name}</node-name>
    </controller-info>

    Note that server.name is simply the name of a sample system property used here to identify the node. Use an appropriate system property that is available in your environment for the Java agent Agent node name. 

    To have tier names assigned dynamically as well, supply a dynamic value to the tier name property, as follows:

    No Format
    java -javaagent:<agent_home>/javaagent.jar -Dappdynamics.agent.tierName=$tierName -Dappdynamics.agent.nodeName=$nodeName

    Combining Properties

    You can combine multiple system properties to name nodes or tiers. For example, in controller-info.xml, combine properties as follows:

    Code Block
    ${system_property_name_1}${system_property_name_2}
    

    You can combine system properties with literals. In the following example "_" and "inventory" are literals.

    Code Block
    ${myhost.name}_${myserver.name}.inventory

    You can use existing system properties for the Controller host and port settings as well; however, combining properties as shown here is not supported for those settings. 

      

    ...