Skip to content

Instantly share code, notes, and snippets.

@foggywow
Last active February 21, 2022 12:55
Show Gist options
  • Save foggywow/a5f04ea5638dfa66da6169b23933e025 to your computer and use it in GitHub Desktop.
Save foggywow/a5f04ea5638dfa66da6169b23933e025 to your computer and use it in GitHub Desktop.
Setup monitorith with Monit & Telegram

Notifications you will recieve with this config

  • free disk space is less than 20% and 10%
  • height is not changing
  • axelard process is not running
  • axelard-vald process is not running
  • tofnd is not running

Prerequires

  • root account on server
  • telegram bot token
  • reciever telegram id

Setup

Create telegram bot

In this guide we won't focus on creating telegram. You can follow this instruction

Get reciever telegram id

Follow this guide to get your telegram id:

How to Setup monitoring

# install required packeges: 
apt install -y monit jq

# important this to run this command from root home dir
cd /root 
git clone https://github.com/Validatrium/axelar.git
cd axelar

echo include '/root/axelar/conf/*' >> /etc/monit/monitrc

## IF YOU HAVE A DIFFERENT RPC PORT (edit 'height.sh' file, to recieve height notifications)
#replace with your rpc address: (example: localhost:26657)
RPC="localhost:26657"

# edit telegram.conf, replacce with your values to recieve alerts
TOKEN=<TOKEN>
CHATID=<YOUR-ID>

# check if you setup telegram notifications correctly: 
bin/sendtelegram -m 'hi there!' -c telegram.conf
# restart monitoring tool
service monit restart

you can also find more monit docs here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment