Install Monika on Linux using Snapcraft

Denny Pradipta
Hyperjump Tech
Published in
4 min readMar 16, 2022

We are improving the availability of Monika in package managers. Last week, we showed you how to install Monika through Chocolatey in Windows, this time we will show you how to install Monika on Linux using Snapcraft.

Snapcraft is a tool for developers to package their apps as app packages for desktop, cloud, and IoT that are easy to install, secure, cross‐platform, and dependency‐free. Using Snapcraft, users can easily discover and install packages from the Snap Store, the app store for Linux with an audience of millions.

In this article, we will show you how to install Monika on Linux using Snapcraft and run a simple configuration using the installed Monika. So, without further ado:

Let us begin.

Installing snapd and Monika

snapd is the background service that manages and maintains your snaps, automatically. Snaps can be used on all major Linux distributions, including Ubuntu, Linux Mint, Debian, and Fedora.

If you are using Ubuntu, snapd is already preinstalled in your system. If by chance you are using other distributions such as Arch Linux, Fedora, or Pop!_OS, follow the official instructions to install snapd in your system.

Once you have installed snapd in your system, verify that snapd is working by running snap in your terminal:

Snap is working as intended

Now that we have our snapd ready, we can install Monika from Snap Store by running snap install monika in your terminal (you may be prompted to enter your sudo password). Wait until the process has been completed, then run monika -v to verify that Monika is installed.

Monika is installed!

Running Monika

What is Monika? 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 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.

Now that we have installed Monika from Snap Store, it’s time to create a new configuration called monika.yml in the current working directory:

Let me explain a little bit about this sample configuration:

  • We are going to use the Desktop notification channel
  • We are going to probe https://reqres.in/api/users/2 URL and it will return a user with ID “2” along with the response status code 200.
  • We want to be notified when the response status code is not 200
  • We want to be notified when the response time is larger than 200 milliseconds
  • We want to be notified when the ID from the response body data is not 3 (this is just for testing purposes)
  • We want to be notified when the incident or recovery has been triggered two times

Now that we have our configuration and Monika ready, it’s time to run monika -c monika.yml in the Terminal:

Monika is working!

Congratulations! You can now monitor your website performances using Monika that you installed from Snap Store!

Closing

Before we added Monika into Snap Store, we prompted users to use NPM to install Monika. Because not many users have NPM in their system as they are not JavaScript developers, we added Monika to the Snap Store so that users can still use Monika without having to install NPM in their system.

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!

Peace out!

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.