Use your Website Sitemap as a Monika Configuration

Denny Pradipta
Hyperjump Tech
Published in
4 min readJul 27, 2022
Photo by Annie Spratt on Unsplash

Taken from the Google website, a sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them. Search engines read this file to crawl your site more efficiently.

Did you know Monika can use or generate a Monika configuration based on your existing website’s sitemap? In case you didn’t know, this feature has been released from Monika v.1.9.2.

This article will show you how to use or generate a Monika configuration based on your existing website’s sitemap. So, without further ado:

Monika is an open-source and free synthetic monitoring command-line application. 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.

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.

To run Monika with your sitemap, make sure that you have a sitemap.xml file available. If you don’t have any sitemap yet, you can simply use a sitemap generator such as https://www.xml-sitemaps.com.

As an example, let’s use the Monika landing page sitemap which can be found at https://monika.hyperjump.tech/sitemap.xml.

Monika Landing Page Sitemap

Save the sitemap.xml file to your local computer. Then, go to your terminal and run the command monika --sitemap <path_to_your_xml> to run Monika with the sitemap.

Run Monika with sitemap.xml

Pretty cool right? But as you can see, if we directly run Monika with the sitemap file, you may notice that there are warnings about no alerts configuration defined. If you are comfortable with the predefined alerts, you may carry on. But if you want to add more alerts, you can generate a Monika configuration based on your sitemap by running monika --create-config --sitemap <path_to_your_xml>

Generate a Monika configuration from a sitemap

Don’t forget that you can use a remote sitemap.xml without having to save the sitemap file to your local just by changing the <path_to_your_xml> to any working link such as https://monika.hyperjump.tech/sitemap.xml.

Bear in mind that creating a Monika configuration based on the remote XML does not work at the moment.

Running Monika with a remote sitemap file

Congratulations, you can now monitor all the pages in your website using Monika!

Closing

A sitemap tells search engines which pages and files you think are important to your site and also provides valuable information about these files. If you already have a sitemap, then it’s easier for you to use Monika.

If you like this article don’t forget to clap and share this with your friends. If you think we miss something, drop your comments below.

That’s it for today, see you in the next article!

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.