cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Gone are the days of point-and-click monotony – we're going full CLI commando! Whether you're managing a lone server or herding a flock of hosts, this guide will transform you from a nervous newbie to a confident commander of the AppDynamics realm. So grab your favorite caffeinated beverage, fire up that terminal, and let's turn those command-line frowns upside down!

Installing the Smart Agent CLI

Before we can conquer the world of application monitoring, we need to arm ourselves with the right tools. Let's start by installing the AppDynamics Smart Agent CLI with Python 3.11, our trusty sidekick in this adventure.

Hosting the Smart Agent Package on a Local Web Server

Before we start spreading the Smart Agent love to multiple hosts, let's set up a local web server to host our package. We'll use Python's built-in HTTP server because, let's face it, who doesn't love a bit of Python magic?

  1. Navigate to your Smart Agent package directory:
cd /path/to/smartagent/package/
  1. Start the Python HTTP server:
python3 -m http.server 8000
  1. Your package is now available at http://your-control-node-ip:8000/smartagent-package-name.rpm

  2. Verify with:

curl http://your-control-node-ip:8000/smartagent-package-name.rpm --output /dev/null

Keep this terminal window open – it's the lifeline for our installation process!

1. Verify Python 3.11 Installation

First, let's make sure Python 3.11 is ready and waiting:

which python3.11

You should see something like:

/usr/bin/python3.11

If Python 3.11 is playing hide and seek, you'll need to find and install it before proceeding.

2. Install the Smart Agent CLI

Now, let's summon the Smart Agent CLI using the magical incantation below (adjust the RPM filename to match your version):

sudo APPD_SMARTAGENT_PYTHON3=/usr/bin/python3.11 yum install appdsmartagent_cli_64_linux_24.6.0.2143.rpm

3. Verify the Installation

Let's make sure our new CLI friend is ready to party:

appd --version

If you see the version number, congratulations! You've just leveled up your AppDynamics game.

Installing Smart Agent on a Single Host

Let's start small and install the Smart Agent on a single host. Baby steps, right?

  1. Prepare your configuration file (config.ini):
[default]
controller_url: "your-controller-url.saas.appdynamics.com"
controller_port: 443
controller_account_name: "your-account-name"
access_key: "your-access-key"
enable_ssl: true

Installing Smart Agent on Multiple Hosts or Locl

Feeling confident? Let's scale up and install the Smart Agent across multiple hosts like a boss!

Preparing Your Inventory

Before we unleash our Smart Agent army, we need to create an inventory of our target hosts. Here are a couple of examples to get you started:

  1. For a simple target with additional ansible variables:
[targets]
54.221.141.103 ansible_user=ec2-user ansible_ssh_pass=ins3965! ansible_python_interpreter=/usr/bin/python3.11 ansible_ssh_common_args='-o StrictHostKeyChecking=no'

Let's break down the provided hosts.ini file:

[targets]
54.221.141.103 ansible_user=ec2-user ansible_ssh_pass=ins3965! ansible_python_interpreter=/usr/bin/python3.11 ansible_ssh_common_args='-o StrictHostKeyChecking=no'

Group

  • [targets]: This is a group name. In this case, the group is named targets. You can use this group name in your playbooks to refer to all the hosts listed under it.

Host

  • 54.221.141.103: This is the IP address of the host that belongs to the targets group.

Host Variables

Several variables are defined for the host 54.221.141.103:

  1. ansible_user=ec2-user:

    • This specifies the SSH user to connect as. In this case, the user is ec2-user.
  2. ansible_ssh_pass=ins3965!:

    • This specifies the SSH password to use for authentication. The password is ins3965!. Note that using plain text passwords in inventory files is generally not recommended for security reasons. It's better to use SSH keys or Ansible Vault to encrypt sensitive data.
  3. ansible_python_interpreter=/usr/bin/python3.11:

    • This specifies the path to the Python interpreter on the remote host. Ansible needs Python to be installed on the remote host to execute its modules. Here, it is set to use Python 3.11 located at /usr/bin/python3.11.
  4. ansible_ssh_common_args='-o StrictHostKeyChecking=no':

    • This specifies additional SSH arguments. In this case, -o StrictHostKeyChecking=no is used to disable strict host key checking. This means that SSH will automatically add new host keys to the known hosts file and will not prompt the user to confirm the host key. This can be useful in automated environments but can pose a security risk as it makes it easier for man-in-the-middle attacks.

This hosts.ini file defines a single host (54.221.141.103) in the targets group with specific SSH and Python interpreter settings. Here's a summary of what each setting does:

  • Connect to the host using the ec2-user account.
  • Use the password ins3965! for SSH authentication.
  • Use Python 3.11 located at /usr/bin/python3.11 on the remote host.
  • Disable strict host key checking for SSH connections.
  1. For multiple managed nodes:
[managed_nodes]
managed1 ansible_host=192.168.33.20 ansible_python_interpreter=/usr/bin/python3
managed2 ansible_host=192.168.33.30 ansible_python_interpreter=/usr/bin/python3 

Save your file named hosts respectively. You can adjust the hostnames, IP addresses, and other parameters to match your environment.

Executing a Local or Multi-Host Installation

We can install on our local host by using the following command.

sudo ./appd install smartagent -c config.ini -u http://your-control-node-ip:8000/smartagent-package-name.xxx --auto-start -vvvv

Now that we have our targets lined up, let's fire away:

sudo ./appd install smartagent -c config.ini -u http://your-control-node-ip:8000/smartagent-package-name.xxx -i hosts -q ssh --auto-start -vvvv

Replace with hosts if you're using the multiple managed nodes setup.

Verifying Installation

Let's make sure our Smart Agents are alive and kicking:

  1. Check the service status:

    sudo systemctl status appdynamics-smartagent
  2. Look for new nodes in your AppDynamics controller UI under Infrastructure Visibility.

Troubleshooting

If things go sideways, don't panic! Check the verbose output, verify SSH connectivity, double-check your config file, and peek at those Smart Agent logs. Remember, every IT pro was once a beginner – persistence is key!


There you have it, intrepid AppDynamics adventurer! You've now got the knowledge to install, host, and deploy Smart Agents like a true CLI warrior. Go forth and monitor with confidence, knowing that you've mastered the art of the AppDynamics Smart Agent CLI. May your applications be forever performant and your alerts be always actionable!

Version history
Last update:
‎07-30-2024 03:56 PM
Updated by:
Join Us On December 10
Learn how Splunk and AppDynamics are redefining observability


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here