The  Splunk AppDynamics Smart Agent command line utility (CLI) is a standalone service that is capable of managing nodes on remote or local hosts. You can install the Smart Agent CLI independently to manage any supported agents. This utility is helpful during the buildtime workflow.

The Smart Agent CLI does not support Database Agent.

Supported platforms

You can use the Smart Agent command line utility on any of the following platforms:

  • Alpine Linux
  • Debian-based Linux
  • RedHat-based Linux

Install Smart Agent CLI

You can install Smart Agent CLI on any host machine. Download the respective files from the Download Portal to the required host machine, then perform the following steps:

  1. Unzip the files at any location
  2. Run the following command to install Smart Agent CLI at the same location:
    sudo [env [APPD_USER=<root-user>] [APPD_GROUP=<root-group>] ./install-script.sh 
    CODE

Use Command Line Utility

This is syntax of the command that you can use to perform agent operations by using the Smart Agent CLI:

appd { operation } { agent } --{ options }
BASH

You can use this syntax for APM agents and Smart Agents.

APM Agents

To manage the app server agents and Machine Agents, the following are the supported values that you can use in the CLI command from the Smart Agent CLI utility:

ParametersValuesDetails
operation
  • install
  • upgrade
  • rollback
  • uninstall
You can perform install, upgrade, rollback, and uninstall operations using the CLI command.
agent
  • java
  • machine
  • node
  • python
  • php
  • db
  • apache
  • iib
  • dotnet_msi
These are the supported agents on which you can perform the operations using the CLI command.
options

Agent options

  • --version
  • --app-name
  • --node-name
  • --tier-name
  • --backup

These are the available flag options for the operation on APM agents. The flag options are categorized into the following:

  • Agent options
  • Connection options
  • Install options
  • Configuration options

Connection options

  • --inventory
  • --connection
  • --remote

Install options

  • --install-dir
  • --install-agent-from

Config options

  • --config
  • --profile

For example: To install Java Agent 23.9.0, run the following command on the Smart Agent CLI:

appd install java --version 23.9.0
CODE

For more examples, see Example Scenarios.

If the controller_url in the Smart Agent CLI config.ini file contains the HTTP or HTTPS protocol, the same protocol is included as the Controller host in the agent controller-info.xml file. If the protocol is not specified, it is excluded from the xml file.

For example, if the controller_url in the config.ini file is http://localhost, then the Machine Agent controller-info.xml file will have the Controller host as http://localhost. However, if the controller_url is localhost, then the Controller host in the Machine Agent controller-info.xml file will also be localhost.

Smart Agent CLI Option-Operation Grid

Operation Install Upgrade Uninstall Rollback
Flags options

version string (latest)  ( -v )

profile string (default)  ( -p )

config string  ( -c )

install-dir string ( -d )

app-name string ( -a )

node-name string ( -n )

tier-name string ( -t )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

instal-agent-from string ( -l )

version string (latest)  ( -v )

profile string (default)  ( -p )

config string  ( -c )

install-dir string ( -d )

app-name string ( -a )

node-name string ( -n )

tier-name string ( -t )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

instal-agent-from string ( -l )

backup bool ( -b )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

Smart Agents

To manage the Smart Agents, the following are the supported values that you can use in the CLI command from the Smart Agent CLI utility:

ArgumentsValuesDetails
operation
  • install
  • upgrade
  • configure
  • uninstall
You can perform install, upgrade, rollback, and uninstall operations using the CLI command.
agent
  • smartagent
The Smart Agent on which you can perform the operations using the CLI command.
options

Agent options

--version

These are the available flag options for the operation on APM agents. The flag options are categorized into the following:

  • Agent options
  • Download options
  • Connection options
  • Install options
  • Configuration options
  • Smart Agent options

Download options

--smartagent-download-url

--install-agent-from

Connection options

  • --inventory
  • --connection

Install options

  • --install-dir

Config options

  • --config
  • --profile

Smartagent options

  • smartagent-download-url
  • --auto-start
  • --attach-configure-file

For example:

appd install smartagent --install-agent-from {path_to_local_artifact} --auto-start
CODE

Smart Agent CLI Option-Operation Grid


Operation Install Upgrade Uninstall Configure
Flags options

version string (latest)  ( -v )

profile string (default)  ( -p )

config string  ( -c )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

instal-agent-from string ( -l )

version string (latest)  ( -v )

profile string (default)  ( -p )

config string  ( -c )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

instal-agent-from string ( -l )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

attach-configure-file string ( -f ) 


Default Values for Smart Agent CLI Utility Flag Options

Option Default Value 

version string (latest)  ( -v )

profile string (default)  ( -p )

config string  ( -c )

install-dir string ( -d )

app-name string ( -a )

node-name string ( -n )

tier-name string ( -t )

inventory string ( -i )

connection string ( -q )

hosts string ( -m )

install-agent-from string ( -l )

backup string ( -l )

attach-configure-file string ( -f ) 

latest

default

/opt/appdynamics/appdcli/config.ini

""

""

""

""

""

local

all

""

false

""

During agent installation, you can use extra vars option to define the required key=value for any variable that is part of Ansible deployment. 

For example, during Machine Agent installation, you can specify the analytics_event_endpoint=https://fra-ana-api.saas.appdynamics.com:443 key-value pair.

appd install machine -c /tmp/config.ini --inventory ./hosts --connection ssh --app-name demo-machine-app --extra-vars "analytics_event_endpoint=https://fra-ana-api.saas.appdynamics.com:443"
CODE

Examples Scenarios

The following sections provide the example scenarios with the command that can be used in the scenario.

Install Java on Local Machine with Default Values

appd install java --install-agent-from /opt/agents/AppServerAgent-1.8-24.10.0.36431.zip --install-dir /opt/java-agent/ --extra-vars download_protocol=local
CODE

Install Java, Node and Machine Agents into the Local Machine or Container with Custom Configuration

You can add these commands in your Dockerfile, Terraform scripts or any CI/CD scripts (local artifact for machine):

appd install java --config /tmp/config.ini --app-name demo-java-app --tier-name demo-java-tier
appd install node -c /tmp/config.ini --app-name demo-node-app --node-name demo-node-name
appd install machine -c /tmp/config.ini --app-name demo-machine-app --install-agent-from /vagrant/appdynamics-machine-agent-23.9.10.zip
CODE

Here, config.ini is the Smart Agent CLI configuration file.

Install Machine Agent to Multiple Hosts in the hosts File

You can run the following command for the mass install of agents on any number of hosts with a single command:

appd install machine -c /tmp/config.ini --inventory ./hosts --connection ssh --app-name demo-machine-app
CODE

Here, config.ini is the Smart Agent CLI configuration file.

Install Smart Agent on Host Machines

When Smart Agent is installed on the host machine, the smartagent service autostarts and is controlled by a flag. You can onboard smart agent to multiple hosts:

appd install smartagent --install-agent-from /vagrant/appdsmartagent_23.10.0-964_amd64.deb -c ./config.ini -i ./hosts -q ssh --auto-start
CODE

Here, config.ini is the Smart Agent CLI configuration file.

Uninstall Smart Agent CLI

  1. Go to the directory where the Smart Agent CLI is installed.
  2. Run the following command to uninstall the CLI:
    sudo [env [APPD_USER=<root-user>] [APPD_GROUP=<root-group>] ./uninstall-script.sh
    CODE