Using Slack in your workplace? Integrate Monika with your Slack channels to receive Monika notifications

Denny Pradipta
Hyperjump Tech
Published in
4 min readNov 3, 2021
Photo by Stephen Phillips - Hostreviews.co.uk on Unsplash

In Indonesia, many companies use WhatsApp as their primary workplace communication application. Sure, it’s efficient at certain times since everyone uses WhatsApp as their daily communication app, but this could cause some people to avoid opening their WhatsApp as their private life and work life is being blended into one app and they have that sense of obligation to open their workplace group chats while they are trying to stay in touch with their families.

Since the COVID-19 pandemic, many employees are working from home, encouraging companies to rely on business messaging tools to communicate between teams. I asked a few friends of mine what tools they are using for workplace communication, and many of them simply answered: Slack.

In this article, I will be sharing how to integrate Monika with Slack. You can integrate Monika with Slack using Incoming Webhook so that when there is a Monika incidents or recoveries alert, your team will be notified via existing Slack channels. So, without further ado:

Let’s do this!

Setup Webhook with Slack

First things first, you need to have a Slack workspace. Create your user account on their website and follow their steps to create a new workspace. Now that we have our workspace ready, head to the Browse Slack and select Apps. Search for an app called Incoming Webhooks.

Incoming Webhooks App

Click Add and you will be redirected to the setup page. Click the Add to Slack button. You will be asked which channels you want to connect with Monika. As an example, I used the #monika-notification channel. After you have selected your channel, click Add Incoming Webhooks Integration button. You should see that your Webhook URL is ready to use.

Example of Webhook URL (Redacted)

Configuring Monika with Webhook

Ever heard of Monika? Just to make sure, it’s not that girl from Doki Doki Literature Club. Monika is an open-source and free synthetic monitoring command-line application. The name Monika stands for “Monitoring Berkala”, which means “periodic monitoring” in the Indonesian language.

With Monika, you can add as many websites as you want to monitor. You can monitor several undesirable events such as service outages or slow services. In addition, you can configure Monika to send notifications of the incidents on your services through your favorite communication tools like SMTP mail, Telegram, WhatsApp (It’s free!), etc.

To run Monika, make sure you have installed Monika by running npm install -g @hyperjumptech/monika if you’re using NPM, but you can also download the prebuilt binary from our release page if you prefer to.

Now that we have our Webhook URL, it’s time to create a configuration called monika.yml:

Monika Configuration File

Let me explain a little bit about this configuration:

  • Monika is using the Slack notification channel. You can change the notification channel by changing type key to another value such as SMTP or WhatsApp. In the data object, there is only one key called url for your Webhook URL
  • Monika will be probing https://github.com and will send you an alert if the response time is greater than 500 milliseconds or the response status code is not 200, meaning the website is down
  • If by chance when probing Github the response time is larger than 10000 milliseconds, you will receive an alert about your internet connection.

Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml

The result

Congratulations! Now that you have successfully integrated Monika with Slack, you will be notified if your website is slow or down!

Closing

Ever since the COVID-19 pandemic, business communication tools become essential for teams to communicate properly as everyone is working from home. Many companies now use Slack for communicating between teams. And when it comes to website monitoring, integrating Slack with Monika can be useful for alerting your teams if your website is down or slow.

If you’re having a problem with using Monika, don’t hesitate to create an issue on Monika’s Github Issue Page. If you like this article, don’t forget to clap and share this article with your friends!

That’s it for today, see you next time!

Hyperjump is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.

--

--

Denny Pradipta
Hyperjump Tech

Full-stack developer who loves to explore new technologies. Uses MongoDB, Express, React, and Node daily. Regularly writing for Hyperjump Technologies.