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.

  • The smartagentctl binary can be used for installing Smart Agent on multiple remote hosts. This binary does not have any library dependencies.

Perform the following steps to install Smart Agent on the Linux or Windows host machine. You can use powershell to run the commands on Windows host.

  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.

    For Linux:

    $ cd appdsmartagent
    $ vim config.ini
    For Windows:
    $ cd appdsmartagent
    $ notepad 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.
    For Linux:
    sudo ./smartagentctl start --enable-auto-attach --service --user <user> --group <group>
    For Linux:
    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.
    For Windows:
     ./smartagentctl.exe start --service
  4. (Optional) If you need to install Smart Agent on a single or multiple remote hosts, perform the following:
    Note: Proxy configuration is not supported for the SSH connection.
    1. (Only for Linux) 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. (For Linux or Windows) Create the remote.yaml file in the current Smart Agent directory.

      This is a sample remote.yaml file for Linux:

      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
          user: "appd-user"
          group: "appd-group"
          username: "ec2-user"
          private_key_path: "/Users/abc123/.ssh/id_rsa"
          temp_folder_path: "/tmp"
          remote_dir: "/opt/appdynamics/smartagent"
      ---  
      

      Here, username is the user who has the permission to perform SSH connection to the remote host using the private key. User and group specifies what permission will be used to run the process.

      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.

      This is a sample remote.yaml file for Windows:
      protocol:
        type: winrm
        auth:
          type: certificate
          cert_path: /path/to/cert.pem
          key_path: /path/to/key.pem
      
      hosts:
        - host: host1.localhost
          remote_dir: /dir1/dir
          protocol:
            type: winrm
            auth:
              type: certificate
              cert_path: host-cert.pem
              key_path: host-key.pem
      
        - host: host2.localhost
          protocol:
            type: winrm
            use_plain_text: true
            auth:
              type: basic
              username: testuser
              password: testpassword

      For details about the parameters, see Requirements to Install Supported Agent on a Remote Host.

    3. Run the following command to start Smart Agent on the remote host:
      For Linux:
      sudo ./smartagentctl start --enable-auto-attach --service --remote
      For Windows:
      ./smartagentctl.exe start --service --remote
  5. To validate the installation, see Validate Smart Agent Installation .
To install Smart Agent on multiple hosts, seeAutomate 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.