Install Smart Agent

You can install Smart Agent on the host machines by logging in to each machine. You can download the respective files from the Download Portal to the required host machine.

Note:
  • Smart Agent is bundled with the smartagentctl binary that simplifies the installation.

  • Agent Management provides Smart Agent CLI that you may use to automate the installation of Smart Agent on multiple hosts. The smartagentctl binary can be also used to install Smart Agent on multiple Linux hosts. For Linux hosts, use smartagentctl because there are no library dependencies.

Run the following command to install Smart Agent on the host machine:

  1. Download the Smart Agent ZIP file from the Download Portal to any location on the required host machine.
    unzip -d appdsmartagent appdsmartagent-<version>.zip
  2. Open the config.ini file in a text editor and replace the placeholder values with the actual access key and the service URL to which you require to connect.
    This information is required for Smart Agent to communicate with the intended service. For the description of each configuration option, see Configure Smart Agent.
    $ cd appdsmartagent
    $ vim config.ini
  3. Install and start Smart Agent by usingsmartagentctl.
    Ensure that you navigate to the directory that includes smartagentctl , then run it with the required variables and parameters. See Variables and Install Parameters.
    sudo ./smartagentctl start --enable-auto-attach --service --user <user> --group <group>
    Note:
    • Sudo is required to run Smart Agent as a service.

    • If there are any issues with LD_PRELOAD, run the command from a new session.

    • This command with or without the --enable-auto-attach parameter, sets the APPD_SMART_AGENTenvironment variable. This is required for the Controller to correlate with the Smart Agent in the Agent Management UI. The supported AppServer agents parse the variable and send the Smart Agent ID to the Controller.
  4. (Optional) If you need to install Smart Agent on a single or multiple Linux remote hosts, perform the following:
    Note: Proxy configuration is not supported for the SSH connection.
    1. Create a user with write permission on the remote directory. If the user already exists, ensure that the user owns the remote directory.
      For example, if the username is ubuntu and you require to install Smart Agent at /opt/appdynamics on the remote machine, then ensure that /opt/appdynamics is created on the remote machine and the ubuntu user owns it. Run the following command to add the ownership:
      sudo chown ubuntu:ubuntu /opt/appdynamics/smartagent/
      If you use existing user, ensure that the user has write permission. Run the following to verify the permissions:
      ls -ld /opt/appdynamics/smartagent  to check the user permissions.
    2. Create the hosts.yaml file in the current Smart Agent directory.

      This is a sample hosts.yaml file:

      batch_size: 5  # This ensures that the installation is done in batches instead of installing the agent on all the hosts simultaneously.
      hosts:
        - name: "host1"  # the name for the remote host 
          host: "localhost"  # the hostname of the primary host
          port: 22       # the default SSH port for the direct communication of primary and remote hosts
          username: "ubuntu"
          private_key_path: "<path-to-private-key>"
          temp_folder_path: "/tmp"  # the temporary folder path of the primary host
          remote_dir: "/opt/appdynamics/smartagent" # path to the remote host directory
        - name: "host2"
          host: "localhost"
          port: 22    #default SSH port
          username: "ec2-user"
          private_key_path: "/Users/akhi85/.ssh/id_rsa"
          temp_folder_path: "/tmp"
          remote_dir: "/opt/appdynamics/smartagent"
      ---  
      

      Here, username can be any username that has write permission on the remote directory.

      For example, if the username is ubuntu and you require to install Smart Agent at /opt/appdynamics/smartagent on the remote machine, then ensure that /opt/appdynamics is created and the ubuntu user owns it. Use sudo chown ubuntu:ubuntu /opt/appdynamics/smartagent/ to add the ownership.

      You can use ls -ld /opt/appdynamics/smartagent to check the user permissions.

    3. Run the following command to start Smart Agent on the remote host:
      sudo ./smartagentctl start --enable-auto-attach --service --remote
To install Smart Agent on multiple hosts, see Automate Smart Agent Installation on Multiple Nodes

Smart Agent Variables

The following table provides the variable details:

Variable NameDescriptionRequiredDefault Value
userUser with which Smart Agent Process should runNo
  • root
  • Administrator
groupGroup with which Smart Agent Process should runNoroot

Smart Agent Install Parameters

The following table provides the optional parameters that you can use:

ParametersDescription
--enable-auto-attachEnable the auto-attach feature. See Auto-Attach Java and NodeJS Agents.
--userSpecify the Smart Agent Process username. The default value will be the current user. The value should be in string format.
--group

Specify the Smart Agent Process group. The default is the current group.

The value should be in string format.

-h, --helpGet help for starting Smart Agent.
--serviceInstall Smart Agent as a service.
--tomcat-env-config

The Apache Tomcat environment file path.

The value should be in string format.

--remoteSpecify this to initiate the installation of Smart Agent in remote host. The value is in boolean format. The default value is true.