Integrate Monika with Gotify as a notification channel

Denny Pradipta
Hyperjump Tech
Published in
4 min readNov 1, 2022

At Hyperjump, one of our priorities is improving Monika integrations with many collaboration tools. We have successfully integrated Monika with Telegram Bots, Slack, Microsoft Teams, Discord, and even WhatsApp too. In October 2022, we added Gotify to Monika’s growing channel choice.

Taken from their official website, Gotify is a simple server for sending and receiving messages. It is free and open source, and also you can self-host Gotify on your own server using Docker. Using Gotify, you can get notifications from Monika by using it as a notification channel.

This article will show you how to integrate Monika with Gotify to get your Monika notifications through the Gotify dashboard. So, without further ado:

Setup Gotify

To demonstrate Gotify as a Monika notification channel, let’s run Gotify using Docker by running this command in the terminal:

docker run -p 8080:80 -v /var/gotify/data:/app/data gotify/server

This command will run Gotify in your local machine at port 8080. If it runs successfully, you should see something like this when you open localhost:8080:

Gotify dashboard

At the sidebar, there is an “Enable notifications” button. Click it, and it will prompt you to give permission to Gotify to show notifications. Click Allow.

Next, login into the server by filling out the username and password fields. The default credential is admin for both username and password. After you are logged in, navigate to the Apps page.

Application page

Proceed by creating a new application, then input the app name and description, and click Create. After you created the app, you will see that there is a token field. Click the eye button to show your app token, and save the token somewhere else as we are going to need it later.

Application token

Integrating Gotify with Monika

Monika is an open-source and free synthetic monitoring command-line application. The name Monika stands for “Monitoring Berkala” in the Indonesian language, which means “periodic monitoring”.

With Monika, you can add as many websites as you want to monitor. You can monitor several conditions such as service outages or slow services. Also, you can configure Monika to send notifications of the incidents on your services through your favorite communication tools like SMTP mail, WhatsApp (it’s free!), Microsoft Teams, Slack, and many more.

There are many ways to install Monika, from Node Package Manager (NPM), downloading binaries from the Monika release page, to package managers such as Homebrew or Snapcraft.

Now that we have our token from Gotify, it’s time to create a Monika configuration called monika.yml

This Monika configuration will:

  • Use Gotify as a notification channel with the provided URL and token. Change the URL to http://localhost:8080 and change the token to your own token
  • Monitor https://github.com at ten seconds interval, and will notify you if there are five consecutive times incidents/recoveries
  • Use default Monika alerts, which are response time is longer than two seconds, and the response status code is not 200.

Once we are ready, it’s time to run Monika with the configuration above by running monika -c monika.yml in your terminal.

Monika with Gotify notification

Congratulations! You can now run Monika with Gotify as a notification channel!

Closing

Gotify also has Android clients, so it will be useful for you who need notifications both on mobile and desktop devices so that you can be more aware of your systems’ downtime. Shoutout to nilsglow at Github for submitting this beautiful pull request!

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