MI Chatbot Deployment

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.

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:

  • Allow all incoming requests to port 443 of the Chatbot application server. This is needed due to the impossibility of identifying the source of requests from Slack to MI Chatbot as there is no general address of incoming requests from the Slack application
  • See the note on connection issues or WebSocket failure in case of the corresponding problem

The process of MI Chatbot deployment is as follows:

Chatbot Deployment Architecture

  1. Connect to the Server by SSH
  2. Download the MI Chatbot Installation Package
  3. Operating Systems Supported
  4. Unpack the Downloaded .tar.gz Archive with the Following Command
  5. Enter the New Unpacked Folder
  6. Initiate the Installation Process
  7. The MI Chatbot Update via Packages
  8. 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 / Building a bot app for Microsoft Teams
  3. Connecting Slack App to Metric Insights
  4. Connecting MI Slackbot to Metric Insights / Connecting Microsoft Teams Chatbot to Metric Insights

1. Connect to the Server by SSH

  1. Use ssh root@000.000.000.000 and replace the zeros with the server IP address.
  2. When prompted, enter the root password provided by your IT specialist.

2. 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).

3. Operating Systems Supported

The list of supported Operating Systems:

  • RHEL 7
  • CentOS 7
  • Ubuntu 18.04
  • Debian 9,10

3.1. Additional Actions for Operating Systems

If you are using a firewall on the Linux machine, inbound TCP ports 80 and 443 are necessary for the MI Chatbot to work correctly. If they need to be opened, use the following commands:

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 --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent

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

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

5. Enter the New Unpacked Folder

cd MetricInsights-Chatbot-<version_number>

6. Initiate the Installation Process

There are two 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
  • Starting v6.x, the installer does NOT support installation on a server with the MI application and requires a separate server
  • The Chatbot installer will not work with an MI application prior to v5.3.0

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.

As an external-facing app, the MI Chatbot 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.

For Slack:
In case there is a connection issue or a WebSocket failure (check for errors with Slack connection test), you will need to:

  • Whitelist the following domains: *.slack.com *.slack-msgs.com *.slack-files.com *.slack-imgs.com *.slack-edge.com *.slack-core.com *.slack-redir.net slackb.com edgeapi.slack.com wss-primary.slack.com wss-backup.slack.com wss-mobile.slack.com app.slack.com a.slack-imgs.com b.slack-imgs.com
  • Check if your proxy is running SSL decryption. If it is, the proxy must either support WebSockets, or you’ll need to exempt the following domains: *.slack-msgs.com wss-primary.slack.com wss-backup.slack.com wss-mobile.slack.com

For more information, see Manage Slack connection issues.

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

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.

7. 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