How to Set Up Your On-Call Duty when Your Witness is Missing a Block?


What is On-Call? You know many Software Engineers at Big Companies need to do On-Call Duties to fix service related issues when they arise.

Yesterday, I presented a utility to switch your node in case of missing too many blocks. But wouldn't it be a lot nicer if we can be notified (be paged) when this happens?
Please be warned that if you like less intrusive notification, you should go for SMS (which should be easy to set up using the method below) or even just email.

Post: Open Source: Auto Switch Your Witness Node In the Event of FailureOpen Source Utility: https://github.com/DoctorLai/SteemWitnessAutoSwitch

This is how we can set up the on-call when missing blocks.

IFTTT

You may have heaeard of IFTTT which snds for If This Then That. This is a powerful service that allows you to connect two or more services.

First, you would need to register a IFTTT account, then you would need to connect the "Webhooks" service which allows you to send a message to the hook. Then, the "That" part would be to connect the "Voip Call" part which will ccall you - alternatively, you could choose other notification methods such as SMS or Emails, or even make aa tweet if ou like!

imae.png

image.png

image.png

image.png

This is hhow the final recipe loks like:

image.png

Note that we can pass a value1 parameter to report the current missing blocks.
Here is how you send a notification message to the webhook aka "This"

curl -X POST -H "Content-Type: application/json" -d '{"value1":"123"}' https://maker.ifttt.com/trigger/{steem-witness}/with/key/YourIFTTTKeyHere

You will see this message on success.
Congratulations! You've fired the steem-witness event

Then, on tthe github code https://github.com/DoctorLai/SteemWitnessAutoSwitch/blob/master/monitor-witness.js , you can modify a little bit:
``
const execSync = require('child_process').execSync;

function reportMissing(missed) {
log("Report missing: " + missed);
// TODO: You can send a email/SMS here
execSync('curl -X POST -H "Content-Type: application/json" -d \'{"value1":"' + missed + '"}\'
https://maker.ifttt.com/trigger/{steem-witness}/with/key/YourIFTTTKeyHere');
}



That is it, everytime there is a missing block, you will get a call who will tell you total missed blocks aka the parameter *value1*

image.png

image.png

image.png

<hr/>

Every little helps! I hope this helps!

**Steem O On!~**
*Repost to Blog*
 ---------

If you like my work, please consider voting for me, thanks!
https://steemit.com/~witnesses type in **justyy** and click ***VOTE***
https://steemyy.com/images/vote-for-justyy.jpg
<BR/>
**Alternatively, you could proxy to me  if you are too lazy to vote!**

Also: you can vote me at the tool I made:  https://steemyy.com/witness-voting/?witness=justyy

### Visit me at:  https://steemyy.com

Comments 7


This post has been rewarded by the Steem Community Curation Project. #communitycuration03

09.06.2020 23:01
0

Thanks very much!

10.06.2020 08:53
0

Good idea! Do you think you could do this for Hive, too?

10.06.2020 04:33
0

Yes, of course. You just need to change the RPC node in the config.json

10.06.2020 08:52
0

拍行长👏

10.06.2020 08:35
0

谢谢,回赞。

10.06.2020 08:52
0

image.png
Hello... I hope you're doing well...
June 10, 2020... 4.3 Hollywood Time...

10.06.2020 11:19
0