For the list of supported platforms, see Supported Platforms; for other Smart Agent requirements, see Smart Agent.

This document contains references to the AnsibleĀ® documentation. Splunk AppDynamics does not own any rights and assumes no responsibility for the accuracy or completeness of such third-party documentation.

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.

  • 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. However, for Linux hosts, we recommend to 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
    CODE
  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
    CODE

  3. Install and start Smart Agent by using smartagentctl.
    Ensure that you navigate to the directory that includes smartagentctl, then run it with the required parameters. See Install Parameters.
    sudo ./smartagentctl start --enable-auto-attach --service --user <user> --group <group>
    CODE
    • 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_AGENT environment 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 require to install Smart Agent on a single or multiple linux remote hosts, perform the following:

    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/smartagent 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/
      CODE

      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.
      CODE
    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/ubuntu/.ssh/id_rsa"
          temp_folder_path: "/tmp"
          remote_dir: "/opt/appdynamics/smartagent"
      ---  
      YAML

      Here, username can be any username that has write permission on the remote directory.
    3. Run the following command to start Smart Agent on the remote host:
      sudo ./smartagentctl start --enable-auto-attach --service --remote  
      CODE

To install Smart Agent on multiple hosts, see Automate Smart Agent Installation on Multiple Nodes.

The following table provides the variable details:

Variable NameDescriptionRequiredDefault Value
userUser with which Smart Agent Process should run No
  • root
  • Administrator
groupGroup with which Smart Agent Process should run Noroot

Install Parameters

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

ParametersDescription
--enable-auto-attachEnable the auto-attach feature. See Auto-attach Agents to Applications.
--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.
--service Install Smart Agent as a service.
--tomcat-env-config

The Apache Tomcat environment file path. 

The value should be in string format.

--remote

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

Configure Smart Agent

You require to configure Smart Agents to register with Controller. Edit the configuration file. For example, if you have downloaded the install files at /opt/appdynamics, navigate to /opt/appdynamics/appdsmartagent/config.ini file and specify the configurations as required

This is an example of a config.ini file:

config.ini

ControllerURL    =
ControllerPort   = 443
FMServicePort  = 8030
AgentType        =
AccountAccessKey =
AccountName      = 
EnableSSL      = true

[CommonConfig]
ServiceName           =
ServiceNamespace      =
RequestTimeoutSeconds = 0
AgentName             =
PollingIntervalInSec  =

[OAuth]
OAuthID      =
OAuthSecret  =
AuthEndpoint =
TenantID     =
Scopes       =

[HTTPClientSettings]
Timeout = 0

[TLSClientSetting]
Insecure = false
AgentHTTPProxy  =
AgentHTTPSProxy =
AgentNoProxy    =

[TLSSetting]
CAFile     =
CertFile   =
KeyFile    =
MinVersion = TLS 1.2
MaxVersion = TLS 1.3

[AutoDiscovery]
RunAutoDiscovery = false
AutoInstall = false
ExcludeLabels = process.cpu.usage,process.memory.usage
ExcludeProcesses =
ExcludeUsers =
AutoDiscoveryTimeInterval = 4h

[AnsibleConfig]
ExtraVars = create_appdynamics_user=false,add_ansible_install_env_var=false,check_pkg_dependencies=false,download_script=py
EnvVars = ANSIBLE_STDOUT_CALLBACK=appdynamics.agents.smartagent_callback
Verbose =

[Telemetry]
LogLevel=info
LogFile=
Profiling=false 
YML

Basic Configuration

The basic configuration is the required configuration to register Smart Agent with Controller. Ensure that you update the following parameters for the basic Smart Agent configuration:

    • ControllerURL: The URL of the Controller on which you want to establish the connection with the Smart Agent.
    • FMServicePort: The port to which the Smart Agent connects to the FM service (Agent Management). It is 8030 for an on-premises Controller and 443 for a SaaS Controller. 
    • AccountAccessKey: The account access key on the Controller.
    • AccountName: The account name on the Controller to which the Smart Agent will report.

    • EnableSSL: SSL is enabled by default. To disable SSL, specify the value as false.

    • config.ini

      ControllerURL    =
      ControllerPort   = 443
      FMServicePort  = 8030
      AgentType        =
      AccountAccessKey =
      AccountName      = 
      EnableSSL      = true
      
      [CommonConfig]
      ServiceName           =
      ServiceNamespace      =
      RequestTimeoutSeconds = 0
      AgentName             =
      PollingIntervalInSec  =
      
      [OAuth]
      OAuthID      =
      OAuthSecret  =
      AuthEndpoint =
      TenantID     =
      Scopes       =
      
      [HTTPClientSettings]
      Timeout = 0
      
      [TLSClientSetting]
      Insecure = false
      AgentHTTPProxy  =
      AgentHTTPSProxy =
      AgentNoProxy    =
      
      [TLSSetting]
      CAFile     =
      CertFile   =
      KeyFile    =
      MinVersion = TLS 1.2
      MaxVersion = TLS 1.3
      
      [AutoDiscovery]
      RunAutoDiscovery = false
      AutoInstall = false
      ExcludeLabels = process.cpu.usage,process.memory.usage
      ExcludeProcesses =
      ExcludeUsers =
      AutoDiscoveryTimeInterval = 4h
      
      [AnsibleConfig]
      ExtraVars = create_appdynamics_user=false,add_ansible_install_env_var=false,check_pkg_dependencies=false,download_script=py
      EnvVars = ANSIBLE_STDOUT_CALLBACK=appdynamics.agents.smartagent_callback
      Verbose =
      
      [Telemetry]
      LogLevel=info
      LogFile=
      Profiling=false 
      YML

Advanced Configuration

You can use the following configurations as per your requirement. These are not mandatory parameters. You can also include these configurations after Smart Agent installation, but ensure to restart Smart Agent to apply the configuration.

Proxy Configuration

If you require to configure the proxy settings, specify the following fields under the TLSClientSetting section of the config.ini file.

ParameterDescriptionExample
AgentHTTPProxyspecify the proxy URL for this parameter when you use an HTTP Controller.

localhost:3128

AgentHTTPSProxyspecify the proxy URL for this parameter when you use an HTTPS Controller.myhost:8443
AgentNoProxyspecify true for this parameter when you do not require to use any proxy for the Smart Agent. The value can be true or falsefalse

The following example is for using the HTTP proxy for the Smart Agent:

[TLSClientSetting]
Insecure = false
AgentHTTPProxy  = localhost:3128
AgentHTTPSProxy =
AgentNoProxy    = 
CODE
TLS Configuration

If you require to configure the TLS certificate, specify the following fields under the TLSSetting section of the config.ini file.

ParameterDescriptionExample
CAFilespecify the path to the root certificate file. <cert file path>/ca.crt
CertFilespecify the path to the client certificate file.  <client cert file path>/clients .crt
KeyFilespecify the path to the client private key of the file. <private key file path>/private.key
Log Level Configuration

 You can specify the log level details in the Telemetry section. You can use any of the following log levels:

  • debug
  •  info
  • warn
  • error

Telemetry

ParametersDescription
LogLevelThe logging level such as info.
LogFileThe path to the log file.
ProfilingSpecify true to enable profiling.

The following example is for using the info log level:

[Telemetry]
LogLevel=info
LogFile=
Profiling=false 
CODE


Start Smart Agent 

Smart Agent can be managed as a system service or a process.

If SELinux is enabled, you require to use the SELinux context of the smartagent file that is applicable through systemd services. Run the following command to change the context, then restart the service:

sudo chcon -t bin_t <smartagent dir>/smartagent  
sudo systemctl restart smartagent
CODE


To restart Smart Agent for a remote host, run the following command:

sudo ./smartagentctl stop --remote 
sudo ./smartagentctl start --remote 
CODE

Start as Process

For Linux, you can start Smart Agent as a process without the sudo access.

For Windows, you require Administrator access to start Smart Agent. Therefore, you cannot start Smart Agent as a process in Windows.

To start the Smart Agent as a process, run the following command:

./smartagentctl start --user <username> --group <groupname>
CODE

To view other operations that you can perform, run the following command:

./smartagentctl --help 
CODE

Start as Service

To start the Smart Agent as a service, run the following command:

For Linux
$ sudo ./smartagentctl start --service
CODE

To stop the Smart Agent service, you can use the following command:

$ sudo ./smartagentctl stop
CODE
For Windows

The Smart Agent service starts when you run the \smartagentctl.exe file in an administrator command line interface:

.\smartagentctl.exe start --service
CODE

To view other operations that you can perform, run the following command:

.\smartagentctl.exe --help 
CODE

For example to stop Smart Agent, you can use the following command:

.\smartagentctl.exe stop
CODE

Validate Smart Agent Installation

Ensure that Smart Agent installation is successful by validating the following steps:

  1. Validate the status of Smart Agent service on the host machine.
  2. Validate the status of Smart Agent registration on the Controller UI.

Status of Smart Agent Service on the Host

For Linux, run the following command from the host machine to check the status of Smart Agent service:

Validate

$ [sudo] systemctl status smartagent.service

For Windows, navigate to Services to verify if the Appdsmartagent service is running.

Validate Status of the Smart Agent Registration on the UI

  1. Navigate to Home > Agent Management > Manage Agents > Smart Agents
  2. The smart agent entry for the host on which it is installed, gets displayed in the table.

Synchronize Smart Agent Primary Host with the Remote Hosts

To ensure that the updates that are done in the Smart Agent gets updated in the remote host, perform the following:

  1. Upgrade the primary host. See Upgrade Smart Agent.
  2. Stop the remote host
    sudo ./smartagentctl stop --remote 
    CODE
  3. Start the remote host
    sudo ./smartagentctl start --remote   
    CODE