This tutorial will show you how to integrate Monika with Ping Method to get your Monika notifications.
Install Monika via
npm install -g @hyperjumptech/monika or if you don’t have NPM in your system, you can download the prebuilt binary from our release page. After installing Monika, run
monika -v to verify your Monika installation.
Now that we have installed Monika, let’s prepare a configuration:
notifications:- id: desktoptype: desktopprobes:- id: ping_testname: ping_testdescription: requesting icmp pinginterval: 10requests:- url: https://google.comping: true- method: GETurl: https://reqres.in/api/usersalerts:- query: response.status != 200message: Status code is not 200- query: response.time > 2000message: Request took more than 2 secondsincidentThreshold: 1recoveryThreshold: 1
Let me explain this configuration a little bit:
Save the configuration above as
monika.yaml in your local machine and run
monika -c monika.yaml command in your terminal inside the directory where you saved the configuration file.
We’re not finished yet. We want to know what will happen if we failed to PING Google. Let Monika run in the background, and try to disconnect yourself from the internet. You will get a notification:
There is some explanation for the error message:
It shows PING timed out because your internet is disconnected. So, we could distinguish which alerts come from the API itself, and which alerts come from your internet problem.
PT Artha Rajamas Mandiri (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.
Copyright © 2023 Hyperjump Tech. All Rights Reserved.