Integrate Monika with Microsoft Teams: Get notifications straight to your channels using Incoming Webhook

Denny Pradipta
Hyperjump Tech
Published in
4 min readNov 16, 2021
Photo by Dimitri Karastelev on Unsplash

I have talked about connecting Monika with Slack and sending Monika notifications through the SMTP servers. Since the COVID-19 pandemic, many employees have been working from home, encouraging companies to rely on business messaging tools to communicate between teams.

My friends talked to me when we published the Slack article and most of them asked: “Can you connect Monika with Microsoft Teams? Because I use Microsoft Teams in my workplace”. It seems that Microsoft Teams is a great collaboration tool alternative to Slack, especially for Office 365 users. No wonder Microsoft Teams hits 250 million monthly active users worldwide this year. Not going to lie, even Hyperjump Tech uses Microsoft Teams.

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

Setup Microsoft Teams Incoming Webhook

First things first, you need to have a team in Microsoft Teams. Download the Microsoft Teams app and create your user account. Then, follow the steps to create a new team. Now that we have our team ready, click the three dots on any channel in your team, and click Connectors.

The team connectors

Inside the connectors dialog, find the Incoming Webhook connector, click Add, and click Add again. Then, open the Connectors menu again, and find the Incoming Webhook again. This time, click Configure. Fill out your Incoming Webhook name, change the logo, and click Create. You should see that there is a new webhook link available for you to use with Monika.

Created Microsoft Teams webhook

Configuring Monika with Microsoft Teams Webhook

Nope, not that girl from Doki Doki Literature Club in case you are wondering. 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:

Let me explain a little bit about this configuration:

  • Monika is using the Microsoft Teams notification channel. You can change the notification channel by changing the 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 Microsoft Teams, you will be notified immediately through Microsoft Teams if your website is slow or down!

Closing

If you are using Office 365 in your workplace, chances are you are using Microsoft Teams as your collaboration tool. Using Incoming Webhook, you can integrate Monika and Microsoft Teams easily. And when it comes to website monitoring, integrating Microsoft Teams with Monika can be useful for alerting your team 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. Until 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.