~/techulus

Thoughts, experiments and ideas.

Free website monitoring with instant push notification alerts

// Written by Arjun Komath

// Mon, Feb 10 2020

In this article, I’ll help you set up a free and simple website monitoring tool which sends instant alerts using push notification. Before we begin, let’s have a look a what we will need:

What is a website monitoring service? It’s simply a tool that lets us check if our website/server is live or not and also send us instant alerts the moment our website/server goes down. There are many SaaS platform which has several other advanced features, but in this tutorial, we will keep things simple.

Before we start, make sure you’ve set up your account at push.techulus.com, installed the app on your device and copied the API key.

Free website monitoring with instant push notification alerts

Get the API key from Push console

Here is the bash script we will be using. You’ve to make two changes:

All you need to do is, download this script into your machine or server and keep running this script in a regular interval using something like cronjob and we’re done! That’s it! 🥳

The script tries to load our website and if it fails (the server doesn’t respond with status code 200 OK), we assume that something has gone wrong and trigger a push notification.

Free website monitoring with instant push notification alerts

Make sure you run this script frequently so that we can be alerted on time. To run this script every minute using cronjob, we can add the following command to crontab. Open crontab using the command

crontab -e

and then add the following line:

/bin/bash /path_to_your_file/script.sh

Make sure that you add the correct and absolute path to the script file on your machine/server.

Feel free to modify the script, maybe change the message to make it more meaningful or more contextual. Before I wrap this up, huge shoutout to vbarrier. The bash script I’m using here is a modified version of his script.

Feel free to leave comments in case you have any questions.

Thank you!