Skip to content

Getting Started

Key Concepts

Before diving into the configuration it is important to understand some key concepts which will be referred to below:

  • host: A host is a computer or virtual machine (locally or in the cloud) in which will have its session controlled.
  • protocol: The protocol to be used for the connection and communication with the host. Check the list of supported protocols.

Supported Protocols

Currently two protocols are supported:

  • RDP
  • AWS EC2 + RDP

RDP - Remote Desktop

To set up a host with Remote Desktop support you will need the following information:

  • Hostname or IP Address to communicate with the host
  • Username for the session to be launched
  • Password for the user session to be launched

AWS EC2 + RDP

This protocol allow you to not only establish the RDP connection with the host but also manipulate the AWS EC2 instance state by starting and stopping it based on the demand from the BotCity Orchestrator Task queue.

To set up a host with AWS EC2 support you will need the following information:

  • Instance ID
  • AWS Region (Optional) the AWS region where this instance is located
  • AWS Access Key ID (Optional) the AWS API Access Key
  • AWS Secret Access Key ID (Optional) the AWS Secret Access Key
  • Hostname or IP Address to communicate with the host
  • Username for the session to be launched
  • Password for the user session to be launched

Tip

The usage of AWS Credentials file is also supported. Make sure to reply Yes during the host add command when asked.

If you use the credentials file, the Region, Access Key and Secret Access Key will not be asked.

Requirements

In order to properly be able to run Session Manager it is mandatory that:

  • Your Session Manager server is able to communicate with the BotCity Orchestrator via HTTPS (Port 443)
  • Your Session Manager server is able to reach the hosts via network in order to manage the sessions
  • The user in usage to execute the Session Manager is allowed to establish RDP or other required connection to the hosts

Installation

Session Manager is part of the BotCity Studio SDK.

In order to obtain the Session Manager please proceed with the installation described in the getting started guide.

Installing as a Windows Service

You can install the BotCity Session Manager as a Windows Service following the instructions below:

Tip

You will a Windows OS with Administrative privileges.

Step 1: Create the Service

  1. Open Command Prompt as Administrator:
  2. Press Win + X and select Command Prompt (Admin) or Windows PowerShell (Admin).

  3. Run the following command to create a new service:

    sc create SessionManagerService binPath="C:\path\to\your\executable.exe"
    
  4. Replace C:\path\to\your\SessionManager.exe with the full path to your .exe file.
  5. Note: Ensure there is no space between binPath= and the path.

Step 2: Set the Service to Start Automatically

  1. Run the following command to set the service to start automatically on system boot:

    sc config SessionManagerService start=auto
    
  2. To start the service immediately, use:

    sc start SessionManagerService
    

Step 3: Verify the Service

  1. Open Services (press Win + R, type services.msc, and press Enter).
  2. Locate SessionManagerService in the list of services to confirm it appears.
  3. Check that the service’s Startup type is set to Automatic.
  4. Reboot the system to verify that the service starts automatically on boot.

Step 4: Testing and Troubleshooting

  • To check the status of your service, you can use:

    sc query SessionManagerService
    
  • If the service does not start, check the log_sm.txt in the logs folder of the BotCity Studio SDK.

  • Alternatively, check the Event Viewer for errors under Windows Logs > Application.

Uninstalling the Service

To remove the service, run:

sc delete SessionManagerService
This command deletes the service entirely.

Configuration

Tip

You can customize the location of your Session Manager configuration database by setting the full path to the smdb file in your conf/conf.bcf under the sessionManagerDBPath.

sessionManagerDBPath=/path/example/BotCity/config_file.smdb

All the configuration for the Session Manager is conducted via the Session Manager command-line interface (CLI).

In order to execute the Session Manager you will need to at least:

  1. Add a host
  2. Attach a Runner to a registered host

Adding a Host

Tip

Before proceeding make sure you have at hand:

  • The IP or hostname for the connection with the host.
  • The username and password which will be used to open the session.
  • Any other pertinent information required by the protocol to be used for the session connection.
  1. Open your command terminal of choice and navigate to the BotCity Studio SDK folder where SessionManager is located.
  2. Execute the command to add a new host SessionManager host add.
  3. Follow the instructions on the prompt.

host add

Attaching a Runner to a Host

Tip

Before proceeding make sure you have at hand:

  • The full path in the host where the BotCity SDK for the desired Runner is installed.
  1. Open your command terminal of choice and navigate to the BotCity Studio SDK folder where SessionManager is located.
  2. Execute the command to add a new host SessionManager runner attach.
  3. Follow the instructions on the prompt.

runner attach

Releasing a Runner from a Host

  1. Open your command terminal of choice and navigate to the BotCity Studio SDK folder where SessionManager is located.
  2. Execute the command to add a new host SessionManager runner release.
  3. Follow the instructions on the prompt.

Listing all Hosts and Associated Runners

  1. Open your command terminal of choice and navigate to the BotCity Studio SDK folder where SessionManager is located.
  2. Execute the command to add a new host SessionManager list all.

list all

Removing a Host

  1. Open your command terminal of choice and navigate to the BotCity Studio SDK folder where SessionManager is located.
  2. Execute the command to add a new host SessionManager host remove.
  3. Follow the instructions on the prompt.

Running

You can run the Session Manager by double clicking on the SessionManager application or by executing the following command for local execution:

SessionManager run local

run-local

Technical Details

How It Works

Session Manager monitors the task queue in real-time, activating resources as the queue grows and deactivating them when demand decreases. It is optimized to provide timely resource allocation, reducing idle time and ensuring resource availability when necessary.

Process Flow:

  1. Monitor Queue: Session Manager continuously monitors the task queue.
  2. Resource Activation: When task demand exists, resources are activated to handle the load.
  3. Resource Deactivation: As demand ceases to exist, resources are released to optimize efficiency and reduce costs.

Troubleshooting

  • Service Fails to Start: Check the sm_out.log in the logs folder of the BotCity Studio SDK. Alternatively, check the Event Viewer for errors under Windows Logs > Application.
  • Configuration Issues: Ensure all configuration settings are correctly defined and match the system specifications.

For further assistance, contact our support team.