autobotAI Linux Agent

Overview

The autobotAI Linux Agent is part of a broad range of automation solutions from autobotAI, including No Code, Low Code, and Full Code options. While the Linux Agent itself supports comprehensive automation, it is particularly useful for interacting with command-line utilities to perform specific actions.

Linux Action Nodes offer a No Code experience, abstracting away the need for manual coding. These nodes empower users to quickly execute tasks leveraging AI, such as running AWS CLI commands or Ansible playbooks—allowing them to focus on outcomes instead of code. For more information on available actions, see About Linux Actions.

Prerequisites

  1. Linux Integration: Ensure you have the necessary integrations set up.
  2. VM Instance: You will need a virtual machine instance running Ubuntu 22.04 or later. Currently, we only support Ubuntu systems.
  3. Minimum Requirements: A minimum instance type of t2.micro on AWS or an equivalent on other providers.
  4. Privilege Mode: The agent service requires to run as root. Ensure you have the necessary permissions to install and operate the agent.
  5. Network Access:
    1. Ensure the host machine has internet access, specifically over port 443 (HTTPS).
    2. Purpose:
      1. To download the agent during setup.
      2. To allow the agent to function, as it cannot operate without internet connectivity.

How to Install the Agent?

To install and set up the autobotAI Linux agent, please follow the steps outlined below.

  • Add a New Linux Integration

    1. First, log in to autobotAI.
    2. Use this link to go to the autobotAI Linux integration page: Linux Integration.
    3. Add a new Linux integration by providing the integration name and group, then click 'Create.' Add Linux Integration
  • Add an Agent

    1. On the next page, add an agent by providing a name in the designated field. Add Agent
  • Generate Credentials

    1. Click "Next Step" to generate the credentials (API URL, Agent API Key, Agent ID) required for the agent. Copy these credentials to a secure location, as you will need them in the next step. Agent Creds
  • Get the Installation Command

    1. Click "Next Step." You will receive an agent installation link. Copy this link and paste it into the terminal on your target agent system. For more information, refer to the Prerequisites. Installation Command
  • Enter Credentials in Terminal

    1. The installation script will prompt you to enter the API URL, Agent API Key, and Agent ID. Input the details you saved in Step 3. Installation Step
  • Verify Installation

    1. After the installation completes, you can verify the agent service status by running the command:
sudo systemctl status autobotAI-agent.service

Verify Installation 1 Verify Installation 2

  1. After completing these steps, the agent will be added to the Linux integration, and you will see a message indicating successful agent registration. You can then start using this integration in your automation workflows.

    Agent Usage

Non-Interactive Installation

If you prefer to install the agent non-interactively, you can execute the following command:

sudo /bin/bash -c "$(curl -fsSL https://autobotai-linux-agent.s3.amazonaws.com/scripts/install.sh)" -- --non-interactive --agent-api-url=<YOUR_AGENT_API_URL> --agent-api-key=<YOUR_AGENT_API_KEY> --agent-id=<YOUR_AGENT_ID>

Note: Make sure to replace <YOUR_AGENT_API_URL>, <YOUR_AGENT_API_KEY>, and <YOUR_AGENT_ID> with the values obtained from the agent credentials you generated during the installation process.

Linux Agent Key Components

Agent Configuration File

The agent configuration file is located at /etc/autobotAI/config.yaml. This file serves as the primary configuration hub for the autobotAI agent. It contains profiles and settings required for executing CLI commands for various cloud providers or tools.

Purpose

The purpose of the configuration file is to define environment variables specific to different profiles. Each profile corresponds to a cloud provider or tool, enabling the agent to operate within distinct environments seamlessly.

Usage

To use the configuration file, you can add new profiles under the profiles section. Here’s an example configuration for an AWS profile:

profiles: aws: # "aws" is the cloud provider staging: # "staging" is the profile name AWS_ACCESS_KEY_ID: "your_staging_access_key" AWS_SECRET_ACCESS_KEY: "your_staging_secret_key" AWS_REGION: "your_staging_region" production: # "production" is another profile name AWS_ACCESS_KEY_ID: "your_production_access_key" AWS_SECRET_ACCESS_KEY: "your_production_secret_key" AWS_REGION: "your_production_region"

NOTE: Make sure to replace the placeholder values with actual credentials for your cloud environments. When adding other providers or tool variables, follow the same schema.

Using Configuration Profiles in Actions

When using Linux actions that require a configuration profile, specify the profile in the format cloud_provider/profile_name. For example, in the Execute Terraform Configuration action, you would specify the profile in the config_profile parameter as aws/staging. This allows the agent to retrieve the correct environment variables associated with the specified profile during the execution of the action

Linux Actions

Linux actions are predefined operations executed via the autobotAI Linux Agent, allowing users to perform various command-line interfaces and scripts on Linux systems within automation workflows. These actions enable seamless integration with cloud providers and automation tools, making resource management more efficient.

Linux Actions are powered by AI, allowing you to leverage AI capabilities to streamline tasks like generating AWS CLI commands or crafting Bash scripts and many more.

We currently support the following Linux actions:

  1. Execute AWS CLI Command
  2. Execute Azure CLI Command
  3. Execute Google Cloud CLI Command
  4. Execute Terraform Configuration
  5. Execute Ansible Playbook
  6. Execute Local Ansible Playbook
  7. Execute Kubectl Command
  8. Execute Kubernetes Manifest
  9. Execute Bash Script

Agent Credentials

The agent credentials are stored in the file located at /root/.autobotAI/credentials. This file contains essential API information required for the agent to authenticate and communicate with the specified services.

Credentials Location

  1. Path: /root/.autobotAI/credentials
  2. Content: The credentials file typically contains the following variables:
    1. AGENT_API_URL: The URL of the API the agent will connect to.
    2. AGENT_API_KEY: The key used to authenticate the agent.
    3. AGENT_ID: The unique identifier for the agent.

Agent Logging

The logs generated by the autobotAI agent are stored in the directory /var/log/autobotAI. This directory contains all log files related to the agent's operations, including error messages, informational logs, and other runtime information.

Log Location

  1. Path: /var/log/autobotAI
  2. Contents: The logs provide insights into the agent's activities and can be useful for troubleshooting and monitoring its performance.

Accessing Logs

You can view the logs using standard command-line tools. For example, to view the latest log entries, you can use:

tail -f /var/log/autobotAI/*.log

This command will display real-time log updates as they occur.

Agent Service Commands

CommandDescription
sudo systemctl status autobotAI-agentCheck the status of the autobotAI agent.
sudo systemctl start autobotAI-agentStart the autobotAI agent.
sudo systemctl stop autobotAI-agentStop the autobotAI agent.
sudo systemctl restart autobotAI-agentRestart the autobotAI agent.
sudo journalctl -f -u autobotAI-agentFollow the logs for the autobotAI agent in real-time.

Update Agent

To update the autobotAI linux agent and ensure it is running the latest version, run the following command:

sudo /bin/bash -c "$(curl -fsSL https://autobotai-linux-agent.s3.amazonaws.com/scripts/update.sh)"

Uninstall/Remove Agent

To uninstall the autobotAI linux agent and remove all its associated data, run the following command:

sudo /bin/bash -c "$(curl -fsSL https://autobotai-linux-agent.s3.amazonaws.com/scripts/uninstall.sh)"