MI Slackbot deployment

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

The MI Slackbot is realized as part of the MI Slack App functionality and works in conjunction with the Slack App built as bot on the Slack Side. After the MI Slackbot has been installed on your Server and the Slack App with bot functions has been built in Slack, the two have to be connected (MI Slack App = MI Slackbot + Slack App).

The whole process comprises the following steps:

  1. MI Slackbot deployment
  2. Building a bot app for Slack
  3. Connecting Slack App 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 Slackbot installation package

  1. Depending on the version, you will be given a link to the corresponding MI Slackbot 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 Slackbot usage.
  4. Click [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:

  1. Debian 7 (wheezy)
  2. Debian 8 (jessie)
  3. Red Hat Enterprise Linux 7
  4. CentOS 6 (depreciated in Release 5.5)
  5. CentOS 7
  6. Ubuntu 14.04

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 Slackbot 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-Slackbot-<version_number>.tar.gz

5. Enter the new unpacked folder

cd MetricInsights-Slackbot-<version_number>

6. Initiate the installation process

  • The MI Slackbot must have an open access to the web.
  • The installation commands below can only be run by a root user.
  • The MI Slackbot can be installed on a server with the pre-installed MI application (Version 5.3.0. and beyond).
  • The Slackbot installer will not work with an MI application prior to 5.3.0

6.1. Install the MI Slackbot on the same server as the main MI application

./installer.py

6.2. Install the MI Slackbot on a separate server

./installer.py --standalone

6.3. 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-slackbot from current system.
-p, --purge Purge mi-slackbot data folders and config files.
--standalone Install Metric Insight Slackbot as standalone service.

7. The MI Slackbot update via packages

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

To update the MI Slackbot: 

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