MI Chatbot Deployment (v6.3.5+)

This article provides a step-by-step instruction on how to install the MI Chatbot on your server and update the bot to a newer version.

The MI Chatbot is implemented as part of the functionality that integrates with the Slack App/MS Teams.

MI Chatbot functionality has been improved in v6.3.5 to simplify the deployment and installation with the following major changes:

  • MI Chatbot for Slack can be installed on the same server as MI application without the DMZ deployment.
  • Chatbot settings are now stored in Metric Insights' database and can be modified via Slack/Microsoft Teams Integration Editors.
  • Security mappings are managed by default in Dashboard DB (the metadata database for Metric Insights) without the need for a separate, manually-created Dataset.

After the MI Chatbot has been installed on the server and the Slack App/MS Teams with bot functions has been built in Slack/MS Teams, MI Chatbot has to be connected with the corresponding app – Slack or MS Teams.

PREREQUISITES:

  • If you are deploying Chatbot for MS Teams, allow all incoming requests to port 443 of the Chatbot application server.

The process of MI Chatbot deployment is as follows:

Chatbot Deployment Architecture

  1. Obtain External Application Credentials
  2. Connect to the Server by SSH
  3. Download the MI Chatbot Installation Package
  4. Operating Systems Supported

4.1. Additional Actions for Operating Systems

  1. Unpack the Downloaded .tar.gz Archive with the Following Command
  2. Enter the New Unpacked Folder
  3. Initiate the Installation Process

7.1. The List of Arguments that Can Be Used During Installation

8.    The MI Chatbot Update via Packages

9.    What's Next?

The whole process of deploying MI Chatbot and connecting it to Metric Insights comprises the following steps:

  1. MI Chatbot deployment
  2. Building a Slack App
  3. Connecting Slack App to Metric Insights
  4. Connecting MI Slackbot to Metric Insights

1. Obtain External Application Credentials

Access Admin > System > External Applications

  1. [+ New External Application]
  2. Make sure the External Application is enabled
  3. Enter a Name for the External Application
  4. [Save]
  5. Set User management access and Cross Domain access to 'yes'
  6. [Save]
  7. Click [Show Credentials] to display the Application ID and Application key. These values are needed to connect the Metric Insights application with the Chatbot

2. Connect to the Server by SSH

  1. Use ssh [email protected] and replace the zeros with the IP address of the server where the Chatbot will be installed
  2. When prompted, enter the root password provided by your IT specialist

3. Download the MI Chatbot Installation Package

  1. Depending on the version, you will be given a link to the corresponding MI Chatbot installation package.
  2. Along with the link, Username and Password will be provided by the MI support team; enter these credentials into the respective fields
  3. Confirm your agreement with the Terms and Conditions of the MI Chatbot usage
  4. [Submit]

This will initiate the download process of the .tar.gz archive (containing all files required to install the system).

4. Operating Systems Supported

The list of supported Operating Systems:

  • RHEL 7, 8
  • CentOS 7
  • Ubuntu 18.04, 20.04, 22.04
  • Debian 9,10, 11
  • Oracle Linux 7
  • Amazon Linux 2

4.1. Additional Actions for Operating Systems

If you are using a firewall on the machine where the Chatbot is installed, opening inbound TCP ports 80 and 443 is necessary for the MI Chatbot to work correctly. Use the following commands to open the ports:

Examples for iptables:

iptables -A INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT

Examples for ufw:

ufw allow 80/tcp
ufw allow 443/tcp

Examples for firewall-cmd:

firewall-cmd --zone=public --add-port=80/tcp
firewall-cmd --zone=public --add-port=443/tcp
firewall-cmd --runtime-to-permanent
firewall-cmd --reload

5. Unpack the Downloaded .tar.gz Archive with the Following Command

tar -zxf MetricInsights-Chatbot-<version_number>.tar.gz

6. Enter the New Unpacked Folder

cd MetricInsights-Chatbot-<version_number>

7. Initiate the Installation Process

There are three options of MI Chatbot installation:

PREREQUISITES:

  • The MI Chatbot must have an open access to the web
  • The installation commands below can only be run by a root user

Install MI Chatbot on the Same Server as MI Application

PREREQUISITE:

Metric Insights application has to be installed on the server before the Chatbot installation process.

Note: MI Chatbot for MS Teams can be installed on the same server as MI Application only if the server has a public address.

Install MI Chatbot on a Separate Server

./installer.py --standalone

Install MI Chatbot on a DMZ Server

The MI Chatbot can also be deployed within a DMZ (Perimeter) network.

In case the Chatbot is used for MS Teams, it must be accessible from the internet. DMZ deployment allows the Bot app to be reachable from the Public Network, while the data it queries from Metric Insights remains securely locked within a Private Network.

For details, view the architecture diagrams for Slack and MS Teams.

7.1. The List of Arguments that Can Be Used During Installation

Required Parameters
--app-id APP_ID Application id for Metric Insights Chatbot.
--app-key APP_KEY Application key for Metric Insights Chatbot.
--app-user APP_USER Application user for Metric Insights Chatbot.
--hostname HOSTNAME Hostname of Metric Insights Application
Optional Parameters
-h, --help Show this help message and exit.
-v, --verbose Output a diagnostic information for every file processed.
--path=INSTALL_PATH Base path for Metric Insights.
-y, --yes Assume yes on interactive requests.
-r, --remove Remove mi-chatbot from current system.
-p, --purge Purge mi-chatbot data folders and config files.
--standalone Install Metric Insight Chatbot as standalone service.
--skip-packages Skip install any additional packages.
--show-packages Show system packages for running Chatbot.
Example Installation Process
  1. Download MI Chatbot installation package
  2. Extract installation files from the downloaded package
  3. Run the installer providing 4 required parameters: --app-id, --app-key, --app-user, --hostname
  4. Wait until MI Chatbot is deployed and check the container list, two new containers should be present: mi-nlu and mi-chatbot. Additionally you can check whether the MI Chatbot is working correctly by accessing <MI hostname>/chatbot/health_check from your browser

8. The MI Chatbot Update via Packages

This method only works if the MI Chatbot has been initially installed via the installation package (as described above).

To update the MI Chatbot: 

  1. Download the new package 
  2. Extract the archive
  3. Install it over the old version